Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in classPath

 
gaurav abbi
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
my classpath is :

.;C:\Program Files\Java\jdk1.5.0_07lib\tools.jar;C:\ProgramFiles\Java\jdk1.5.0
_07\bin;C:\Program Files\Java\jre1.5.0_10\bin;C:\Program Files\Java\jre1.5.0_10\
lib;C:\j2sdk1.4.2_04;C:\j2sdk1.4.2_04\jre\lib;C:\j2sdk1.4.2_04\jre\lib\comm.jar;
C:\j2sdk1.4.2_04\bin;D:\gaurav\workBench\ONSStudio;D:\gaurav\workBench\ONSStudio
\Installer\jdom.jar;D:\gaurav\workBench\ONSStudio\Installer\jdom-contrib.jar;D:\
gaurav\workBench\ONSStudio\Pythonfiles\JSGEN;C:\Program Files\Java\jre1.5.0_07;E
:\gaurav\j2ee\apache-tomcat-5.5.20\common\lib\servlet-api.jar

in the start only i've put java 1.5 references, but still it picks java 1.4 versions only and throws me errors for any java 1.5 features

any idea what else i need to do?
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is not in your classpath - but most likely in your path environment variable. What is the value of your path?

Regards,
JD
 
Henry Wong
author
Marshal
Pie
Posts: 21002
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another item to look for... if you are not running your Java program directly with the java command, but via a batch file, the classpath may be "initialized" by your batch file.

Henry
 
gaurav abbi
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
my path variable is

C:\Program Files\Java\jre1.5.0_07;C:\Program Files\Java\jre1.5.0_07\bin;C:\j2sdk
1.4.2_04\bin;E:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Progra
m C:\j2sdk1.4.2_04\bin;E:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin
;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Python24;C:\WINDOWS\system32;C:\Progra
m Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Vi
sual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\T
ools;C:\Program Files\Microsoft Visual Studio\VC98\bin

and i'm running from command prompt only

java test
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought it was path not classpath when I saw your first post.
Your first JDK entry is for JDK 1.4; you need to enter your JDK 1.5.0 path in a similar format before the JDK 1.4 entry. Make sure the JDK entries end with \bin (Windows, I think /bin on Linux), and you would probably do well to delete the 1.4 entry.

When the computer looks for the entry "java" using the path as set up, the first one it finds is in your jdk1.4 installation; if you require Java 5 features, your application will crash.

Please check whether the jre entries ought to end with \bin too.

Hope this helps.

CR
 
gaurav abbi
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
thanks for your replies, its working now..

but i've one doubt.
whats the difference b/w "classpath" and "path" variable.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gaurav abbi:
...whats the difference b/w "classpath" and "path" variable.

See PATH and CLASSPATH.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic