Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath problem

 
Anjali Vaidya
Ranch Hand
Posts: 40
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What value does your classpath env variable contain?
 
Anjali Vaidya
Ranch Hand
Posts: 40
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It contains
.;C:\Program Files (x86)\Java\jdk1.5.0_08\lib;
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you exit and re-enter the cmd after setting the environment variables?
 
Anjali Vaidya
Ranch Hand
Posts: 40
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i deleted it and created it again. Then i restarted the cmd
now it is working
thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic