Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 5 of 5
  1. #1
    cavneb's Avatar
    cavneb is offline Registered User
    Join Date
    Aug 2001
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I set a CLASSPATH for java?

    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?



    Eric Berry
    cavneb@mac.com

  2. #2
    didde is offline Registered User
    Join Date
    Dec 2001
    Location
    se-sthlm
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Think so...

    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.

  3. #3
    cavneb's Avatar
    cavneb is offline Registered User
    Join Date
    Aug 2001
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking That did the trick

    That worked! Thanks

  4. #4
    iconara's Avatar
    iconara is offline Registered User
    Join Date
    Sep 2000
    Location
    Gothenburg, Sweden
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Mac LC 475, Mac OS 7.5.3

  5. #5
    cavneb's Avatar
    cavneb is offline Registered User
    Join Date
    Aug 2001
    Location
    UK
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    another way

    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


 

 

Similar Threads

  1. set classpath on Mac OS X v 10.1
    By sumeetG in forum Software Programming & Web Scripting
    Replies: 0
    Last Post: April 9th, 2003, 04:28 AM
  2. HOW TO STOP SPAM -- join the fight!
    By GadgetLover in forum Apple News, Rumors & Discussion
    Replies: 11
    Last Post: April 11th, 2002, 02:52 PM
  3. AppleScript, iTunes, Mp3 Tags, idea and problem
    By jove in forum Software Programming & Web Scripting
    Replies: 0
    Last Post: March 11th, 2002, 04:03 PM
  4. how would I zip files?
    By themacko in forum Mac OS X System & Mac Software
    Replies: 14
    Last Post: February 18th, 2002, 04:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •