New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

How to set CLASSPATH, or PATH


Post Reply New Thread Subscribe

 
Thread Tools
jhoomjhoom

 
jhoomjhoom's Avatar
 
Member Since: Jan 23, 2010
Posts: 53
jhoomjhoom is on a distinguished road
Mac Specs: MacBook Air / 1.86GHz / 2 GB / Version 10.6.2

jhoomjhoom is offline
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
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac 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

rman is offline
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!
QUOTE Thanks
DarkestRitual

 
Member Since: Apr 09, 2009
Location: Ithaca NY
Posts: 2,073
DarkestRitual is just really niceDarkestRitual is just really niceDarkestRitual is just really niceDarkestRitual is just really nice
Mac Specs: 13 inch alMacBook 2GHz C2D 4G DDR3, 1.25GHz G4 eMac

DarkestRitual is offline
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.

Quote:
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
QUOTE Thanks
jhoomjhoom

 
jhoomjhoom's Avatar
 
Member Since: Jan 23, 2010
Posts: 53
jhoomjhoom is on a distinguished road
Mac Specs: MacBook Air / 1.86GHz / 2 GB / Version 10.6.2

jhoomjhoom is offline
Thank you for the advice.

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

Thanks,
jhoom jhoom
QUOTE Thanks
DarkestRitual

 
Member Since: Apr 09, 2009
Location: Ithaca NY
Posts: 2,073
DarkestRitual is just really niceDarkestRitual is just really niceDarkestRitual is just really niceDarkestRitual is just really nice
Mac Specs: 13 inch alMacBook 2GHz C2D 4G DDR3, 1.25GHz G4 eMac

DarkestRitual is offline
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.
QUOTE Thanks
jhoomjhoom

 
jhoomjhoom's Avatar
 
Member Since: Jan 23, 2010
Posts: 53
jhoomjhoom is on a distinguished road
Mac Specs: MacBook Air / 1.86GHz / 2 GB / Version 10.6.2

jhoomjhoom is offline
Wow, that sounds like fun :-)

Thanks,
jhoom jhoom
QUOTE Thanks
XJ-linux

 
XJ-linux's Avatar
 
Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,359
XJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond reputeXJ-linux has a reputation beyond repute
Mac Specs: MacBookAir5,2:10.9.5-MacMini3,1:10.9.5-iPhone6,1:8.1

XJ-linux is offline
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!

"Those who don't understand Unix are condemned to reinvent it, poorly." Henry Spencer
QUOTE Thanks
jhoomjhoom

 
jhoomjhoom's Avatar
 
Member Since: Jan 23, 2010
Posts: 53
jhoomjhoom is on a distinguished road
Mac Specs: MacBook Air / 1.86GHz / 2 GB / Version 10.6.2

jhoomjhoom is offline
Thanks!

Thanks,
jhoom jhoom
QUOTE Thanks

Post Reply New Thread Subscribe


« New Macbook & transferring info | Getting a WRT54G to hook up to my iMac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Default path changed kevinchkin OS X - Development and Darwin 2 02-03-2009 12:49 AM
please review my process to create a raid set briang Apple Desktops 2 10-17-2008 04:03 PM
XCode Include path problem Jove OS X - Development and Darwin 0 03-18-2005 10:41 AM
how can i set the path? Bo Eddy OS X - Development and Darwin 1 05-12-2004 11:45 AM
Getting the full path of a file rcwhite OS X - Operating System 1 03-13-2004 02:36 AM

All times are GMT -4. The time now is 10:02 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?