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

classpath question

amouro wu
Greenhorn

Joined: Dec 30, 2003
Posts: 1
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

Joined: Jan 07, 1999
Posts: 6920
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?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath question