File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError . exception Problem

 
RajTilak Sivaluri
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using windows 7 platform i installed java 6 and i am trying to compile a small java program producing an output helloworld! but when i try to run the program i am finding an exception saying NoClassDefFoundError

The error looks as below:


C:\Test>java Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test. Program will exit.


The program i pretty simple i am just printing Hellow World !!
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure it is in your directory and it isn't in a package?
 
RajTilak Sivaluri
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i tried its in my directory . Infact i tried to place this test.java file in the bin folder of java and i opened that path in command prompt and i tried to compile that . when i compile i find no error but when i try to run i am getting this exception and when i check out for the class file its there along with .java file .

I even tried to reinstall the java software still i face this problem
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it Test or test? Classnames should begin with an uppercase character. And Java is case-sensitive.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12022
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also, is your CLASSPATH environment variable set? If so, to what?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic