PDA

View Full Version : How do I set a CLASSPATH for java?



cavneb
June 13th, 2002, 04:22 AM
I am run a program that's written in java, but I need to install a few API's to do so (JavaMail v1.2, Java Activation Framework v1.0). How do I set the CLASSPATH in the environment so that I can actually use these?

Also, do I actually need to install the JAF or does OS X already have that?

:confused:

Eric Berry
cavneb@mac.com

didde
June 13th, 2002, 06:34 AM
I'm not at my Mac right now, but you can put the .JAR:s in "/System/Library/Java/Extensions". Or you can always use the "-cp" switch along with "java" when you're running your app.

I.e: "java -cp /my/own/classes/jar.jar:/my/own/classes/jar2.jar myApp"

... I don't recall ever seeing JAF by default on X. But I could be wrong. Should be a breeze to add though if it's not already there.

Good luck!

//Dd.

cavneb
June 13th, 2002, 07:45 AM
That worked! Thanks :)

iconara
June 13th, 2002, 08:52 AM
in your "~/.tcshrc file":

setenv CLASSPATH "a/jar/file.jar:another/jar/file.jar"

alias java 'java -cp $CLASSPATH'


dunno if the last line is neccessary though.


t

cavneb
July 10th, 2002, 11:31 AM
another way that I found out, and which if found to be much easier, is to install bash shell and use that by default.

It seems to me that the bash shell is TONS easier.

with bash, i just insert into the .bash_profile the command:

export CLASSPATH=:ext:name@server:/cvs/path

:D :D :D