• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on how to run an application....

 
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)

 
buckaroo
Posts: 401
Postgres Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The name of Class and Java file is the same so what part I am doing wrong?
Asma
 
Donald R. Cossitt
buckaroo
Posts: 401
Postgres Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another thing; when you run your file are you running it from the console? If you are, remember that case is important. If your file name is Test.java then you need to type: "java Test", "java test" will produce an error similar to the one you posted; as will typing "java Test.java" will produce similar error.
HTH
doco
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic