Results 1 to 8 of 8
  1. #1

    jhoomjhoom's Avatar
    Member Since
    Jan 23, 2010
    Posts
    53
    Specs:
    MacBook Air / 1.86GHz / 2 GB / Version 10.6.2
    How to set CLASSPATH, or PATH
    Hello,

    I have Mac Air Book and am using it to study Java programming for a certification exam (required by my job). So far when I write code and save it to a directory, it complies. Now it seems I need to learn about CLASSPATHs and setting them. When I open the terminal and type in

    Code:
    echo $CLASSPATH
    I get a blank output

    however, if I type in

    Code:
    echo $PATH
    I get some directories that end in /bin


    Questions
    1. How do I set and edit CLASSPATH, or PATH
    2. Does the Mac OS use CLASSPATH, or PATH, or both


    Please point me in the correct direction
    Thanks,
    jhoom jhoom

  2. #2

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    Specs:
    2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
    Cool
    PATH is an environmental variable. What you saw was your search path for UNIX command/binaries/applications.

    If you are running borne/korne shell then do the following:

    CLASSPATH=
    export CLASSPATH

    or

    export CLASSPATH=

    put what ever you want after the equals sign
    Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!

  3. #3


    Member Since
    Apr 09, 2009
    Location
    Ithaca NY
    Posts
    2,073
    Specs:
    13 inch alMacBook 2GHz C2D 4G DDR3, 1.25GHz G4 eMac
    The $PATH environment variable sets all of the locations where your system looks for scripts, so that if you just type "name_of_script" and nothing else (like "open 'file/path/of/script") it will still open.

    You're running BASH i am assuming, since it is the default shell of the OS X command line. I highly recommend installing VirtualBox and Ubuntu 10.04 though to mess around with shell scripting and other programming. That way you won't eff your computer.

    from linuxcommand.org

    You can add directories to your path with the following command, where directory is the name of the directory you want to add:

    [me@linuxbox me]$ export PATH=$PATH:directory

    A better way would be to edit your .bash_profile file to include the above command. That way, it would be done automatically every time you log in.

    Most modern Linux distributions encourage a practice in which each user has a specific directory for the programs he/she personally uses. This directory is called bin and is a subdirectory of your home directory. If you do not already have one, create it with the following command:

    [me@linuxbox me]$ mkdir bin
    Note in OS X the file is not ~/.bash_profile but ~/.profile

  4. #4

    jhoomjhoom's Avatar
    Member Since
    Jan 23, 2010
    Posts
    53
    Specs:
    MacBook Air / 1.86GHz / 2 GB / Version 10.6.2
    Thank you for the advice.

    Fortunately, I already have VirtualBox loaded with Ubuntu, will code from there.
    Thanks,
    jhoom jhoom

  5. #5


    Member Since
    Apr 09, 2009
    Location
    Ithaca NY
    Posts
    2,073
    Specs:
    13 inch alMacBook 2GHz C2D 4G DDR3, 1.25GHz G4 eMac
    Excellent! Might wanna up your RAM to get that ubuntu machine really humming. I've got 2 gigs of ram to my ubuntu VM and 128MB of VRAM for it, it's pretty sweet. I've been playing around in OS X, so I've customized my terminal and added some aliases and stuff... like, i type "code" and out pops smultron - added CLICOLORS (enabled by default in ubuntu) and customized the scheme a bit... but i really need to get back into the linux VM tomorrow night and start working again.

  6. #6

    jhoomjhoom's Avatar
    Member Since
    Jan 23, 2010
    Posts
    53
    Specs:
    MacBook Air / 1.86GHz / 2 GB / Version 10.6.2
    Wow, that sounds like fun :-)
    Thanks,
    jhoom jhoom

  7. #7

    XJ-linux's Avatar
    Member Since
    Jul 02, 2007
    Location
    Going Galt...
    Posts
    3,449
    Specs:
    MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.4.1
    If you want to have some real fun, type env at the command line. You should get every good idea of most of the items applied to your user's session. God luck with your certification!
    Never judge a man, untill you have walked a mile in his shoes...
    That way you'll be a mile away from him, and you'll have his shoes.

  8. #8

    jhoomjhoom's Avatar
    Member Since
    Jan 23, 2010
    Posts
    53
    Specs:
    MacBook Air / 1.86GHz / 2 GB / Version 10.6.2
    Thanks!
    Thanks,
    jhoom jhoom

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to set my Finder file screen to original set-up
    By nflder in forum Switcher Hangout
    Replies: 11
    Last Post: 07-07-2015, 01:37 AM
  2. "Use UNC path from Active Directory" not opening the entire path
    By jjw3579 in forum OS X - Operating System
    Replies: 1
    Last Post: 09-22-2011, 11:12 AM
  3. Replies: 1
    Last Post: 02-28-2010, 11:05 AM
  4. how to set my path?
    By icthy in forum OS X - Development and Darwin
    Replies: 11
    Last Post: 09-13-2009, 09:20 PM
  5. how can i set the path?
    By Bo Eddy in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 05-12-2004, 10:45 AM

Posting Permissions

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