Example
#{example}"); ipb.editor_values.get('templates')['togglesource'] = new Template(""); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
Emoticons
"); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html]\n \n[/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]5 Replies - 58 Views - Last Post: Today, 02:43 PM
#1
Reputation: 0
- Posts: 9
- Joined: 19-May 13
Posted Today, 12:07 PM
I compiled succesfuly all classes that I have in this project, but than when I tried to run it in cmd with java Main, cmd says:Exception in thread "main" java.lang.NoClassDefFounderror: Main
Replies To: java console application run via cmd
#2
Reputation: 5440
- Posts: 8,760
- Joined: 19-March 11
Re: java console application run via cmd
Posted Today, 12:15 PM
Sounds like java isn't finding a class called MainThere's a couple of reasons why that could happen. One is that that class just doesn't exist. Another is that it exists, but Java can't find it. If you list the directory you're in, and you see Main.class, please post the code for that class. If you don't see that class, that's probably why you're getting this error.
This post has been edited by jon.kiparsky: Today, 12:15 PM
#3
Reputation: 0
- Posts: 9
- Joined: 19-May 13
Re: java console application run via cmd
Posted Today, 12:40 PM
I type in cmd dir, and it shows me all the classes with .class that I compiled.. Here is the additional report to Exception in thread "main".. i41.tinypic.com/acxwjk.jpg Like what do you think cause problem, imports ? I'm using Netbeans IDE, and pretty much everything shows up and run correctly, but from cmd.. i don't get
#4
Reputation: 5440
- Posts: 8,760
- Joined: 19-March 11
Re: java console application run via cmd
Posted Today, 01:03 PM
That'll explain it. Netbeans is probably creating packages for your program - this is good practice, but when you're running from the command line, you have to call the class from the right place. A package is a directory - so if you seepackage net.kiparsky.foo
java will look for these class files under the directory ./net/kiparsky/foo
So if I try to run a file with that package declaration from the directory it's in:
/Users/jon/java/junk:514 $ ls Junk.class Junk.class [jon: Sat May 25 15:58] /Users/jon/java/junk:515 $ java Junk Exception in thread "main" java.lang.NoClassDefFoundError: Junk (wrong name: net/kiparsky/foo/Junk) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [jon: Sat May 25 15:58] /Users/jon/java/junk:516 $
But if I put it in the right directories:
/Users/jon/java/junk:521 $ mv Junk.class net/kiparsky/foo/ [jon: Sat May 25 16:00] /Users/jon/java/junk:522 $ java net/kiparsky/foo/Junk Hello, World! [jon: Sat May 25 16:00]
So what you want to do is look at the package declaration at the top of your source file, and cd up until you're one level outside of that hierarchy. If it's a one-level package:
package foo;
Then you'll just cd up one level, then run foo/Main
That should get you there.
#5
Reputation: 0
- Posts: 9
- Joined: 19-May 13
Re: java console application run via cmd
Posted Today, 01:18 PM
So I decided to create a new project, with a one level package just like I have in my primary project, and I'm actually inside that one level dir, I type dir to see files, and it shows me HelloWorld.java and HelloWorld.class, than I type in java HelloWorld.. and it's showing me the same exception..??
#6
Reputation: 5440
- Posts: 8,760
- Joined: 19-March 11
Re: java console application run via cmd
Posted Today, 02:43 PM
Quote
I'm actually inside that one level dir, I type dir to see files, and it shows me HelloWorld.java and HelloWorld.class, than I type in java HelloWorld.. and it's showing me the same exception..??
So if you have this code:
package hello; public class HelloWorld{ // nothing surprising here }
and you're actually in the directory hello, and you see the HelloWorld.class file, then you need to change directory and go one level up. Then you can run the class with
>> java hello/HelloWorld
Page 1 of 1
Source: http://www.dreamincode.net/forums/topic/321810-java-console-application-run-via-cmd/
Herman Melville Books Kyna Treacy megan fox Lane Goodwin Romnesia Tagg Romney Bosses Day
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.