File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes classpath problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "classpath problem" Watch "classpath problem" New topic
Author

classpath problem

Anjali Vaidya
Ranch Hand

Joined: Jan 25, 2011
Posts: 40

There is a problem I get everytime i try to execute a .class file in cmd. For example a simple Hello program compiles with javac Hello.java
It does not execute when i say java Hello
but it executes successfully when i say java -classpath . Hello

Why is it happening so? All my environment variables are set properly
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

What value does your classpath env variable contain?


Swastik
Anjali Vaidya
Ranch Hand

Joined: Jan 25, 2011
Posts: 40

It contains
.;C:\Program Files (x86)\Java\jdk1.5.0_08\lib;
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Did you exit and re-enter the cmd after setting the environment variables?


Mohamed Sanaulla | My Blog
Anjali Vaidya
Ranch Hand

Joined: Jan 25, 2011
Posts: 40

i deleted it and created it again. Then i restarted the cmd
now it is working
thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath problem