• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Question on how to run an application....

 
Ranch Hand
Posts: 291
  • 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)

 
buckaroo
Posts: 401
  • 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
  • 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
 
Ranch Hand
Posts: 59
  • 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.
 
Sheriff
Posts: 7023
 
    Bookmark Topic Watch Topic
  • New Topic