*
The moose likes Beginning Java and the fly likes Question on how to run an application.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Question on how to run an application...." Watch "Question on how to run an application...." New topic
Author

Question on how to run an application....

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
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

Joined: Jan 31, 2003
Posts: 401
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


doco
Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
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

Joined: Feb 09, 2003
Posts: 59
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.


----------------------------------<br />SCJP 1.4
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to The IDEs and Other Tools Forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
wood burning stoves
 
subject: Question on how to run an application....
 
Similar Threads
Profiling
Sealing Violation
please help running programs created in jsdk 1.4 into jsdk 1.6
Question on how to run an application....
How to use the book CD tester