aspose 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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 1400
    
    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: 3056
    
  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
 
Similar Threads
need advice:memory loss,can i still manage to keep my job
jar file and classpath relation
if else in nested if
try, catch,finally
Number of Object created on String creation?