Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath question

 
amouro wu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can compile using a classpath set up by means of the
environment variable.
I can also compile using the -classpath parameter of the javac line command. The problem comes when using the two together.
Does the -classpath parameter override or overridden by,
precede or succeed the classpath environment variable.
Thanks,
amo
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The command line classpath overrides the CLASSPATH environment variable setting. If you want to use both, the trick is to include the environment variable in your command-line argument.
On Windows, something like:
java -classpath %CLASSPATH%;some.jar;c:\myprojects\thing\classes
On Linux, Unix, etc. something like:
java -classpath $CLASSPATH:some.jar:/usr/me/myprojects/thing/classes
Does that help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic