This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on how to run an application....

 
Elahe Shafie
Ranch Hand
Posts: 291
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I have a simple application which is:

class Test
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}

and I do not know how to run it in Forte 2.0 Community Edition?
I tried to run it but I got this Error!
Could you please help me whoever is familiar with Forteh or let me know where I can ask?
Many thanks,
Asma
Error
========
java.lang.NoClassDefFoundError: WEB-INF/classes/com/srs/bugtrack/Test (wrong name: Test)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know nothing about Forte 2.0. But I have seen that error many times in the beginning. Are you trying to run the program from the console? When I got that error it was because I had placed package packageName; in my code then tried to run the file from the console while being in the same folder as the class.
Comment out your // package packageName; then recompile then run your code again. Having said all that, if you are trying to run your class from within your IDE, it is curious to me that this error would come from running the program from within your IDE.
HTH
doco
 
Elahe Shafie
Ranch Hand
Posts: 291
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off thank you so much for the response.
But I do not have any Package to Comment out
Hope to get more help,
Asma
 
Syamsul Hussin
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make sure the name of the class is the same as the name of the file .java.
if the name of the class is Test then the name of the file should be Test.java
hope this helps.
 
Dirk Schreckmann
Sheriff
Posts: 7023
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic