Import Java Package, put where?

in Genius Bar edited January 2014
Ok so I have a java library package that I have to import whenever I create my java applications. My question is where does this file go? I am new to programming on the mac and I know on windows you had to set CLASSPATH=.;c\javalib\\ etc. but what do I do for Mac OS X?


  • Reply 1 of 1
    nttntt Posts: 18member
    Depends on where you're doing your compilation from, I guess.

    If you're compiling in Terminal using javac, then you would want to refer to its location in a file called .bash_profile in your home directory.

    export CLASSPATH=".:$CLASSPATH:/path/to/required/jarfile"

    This is run every time you start a new terminal (assuming you're using bash which is default on Panther).

    You can put the actual jar file anywhere you want.
Sign In or Register to comment.