File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes java command not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java command not working" Watch "java command not working" New topic
Author

java command not working

Hemang Thanki
Greenhorn

Joined: Jan 24, 2005
Posts: 18
Hi Everyone,

I am using Windows XP SP1.

When I type javac <<File.java>> on commandline, it successfully compile the file.
But when i use java <<File>> on commandline,
"Exception in thread "main" java.lang.NoClassDefFoundError: <<File>>"
though the file consists of main method.

I also set the Path env. variable.

Can anyone suggest me some other approach ?

Regards,
Hemang
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Um this really isn't the right place for that question... but you have a problem with the name of the file and the name of the class not being the same (or at least thats my first impression).


-Tad
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Moved to Java in General (beginner).
Marco Davids II
Greenhorn

Joined: Nov 02, 2004
Posts: 24
sounds like a like classpath problem.
the classpath variable tells the jvm where to locate java classes
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
See How to Set the Classpath in our Java Ranch FAQ for details on setting this system variable. Be sure to add the current working directory to the classpath by prepending the list with ".;".

Layne


Java API Documentation
The Java Tutorial
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java command not working