Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Up the garden CLASSPATH (Help installing a little jav app...)

Up the garden CLASSPATH (Help installing a little jav app...)
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 13, 2003, 11:59 AM
 
OK so I'm getting into developing web sites using XML as a data source and transforming it into XHTML using XSLT and the Xalan XSLT processor. Only I would be if I knew how to install Xalan.

My UNIX skills would best be rated as weak-to-lame so I'm a bit lost as to how exactly to go about installing this Java app. The instuctions for how to install the app can be found at:

Xalan: Getting Started

But I'm not sure where the correct place to install the app is (/usr/local/bin ?) and how I should go about setting the system classpath.

So if anyone could help this pathetic UNIX newbie reach XSLT nirvana he would be most appreciative
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jun 13, 2003, 01:30 PM
 
It's a jar file. You can put it wherever you like, as long as you add it to your classpath. Apple generally recommends user-level jar files go into ~/Library/Java -- which is where I put all of mine.

To actually get it in your classpath, you need to add it. How to do that depends on your shell. If you're using csh or tcsh, switch! If you're using zsh, ksh, or bash, add this to your appropriate resource file (for bash it's ~/.bashrc, for ksh it's ~/.kshrc, etc):

Code:
CLASSPATH="${CLASSPATH}:/Library/Java/xalan.jar:/Library/Java/xml-apis.jar:/Library/Java/xercesImpl.jar" export CLASSPATH
You can get pretty fancy with this stuff, but that's the bare bones basic for those three jars.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
tru322  (op)
Fresh-Faced Recruit
Join Date: Aug 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 13, 2003, 04:22 PM
 
Well I'm running the default 10.2.6 shell (tcsh???) so how would I go about setting the classpath in that?

Oh and seeing as I should probably trying to learn how the UNIX shell works (mainly so I don't go screwing everything up too badly) what exactly is the classpath and what does it do?


To be honest I think its best for me to stick with the default shell seeing as I don't use it for anything more exciting than running the occasional top/ps, ssh and mysql session and generally any docs for OS X UNIX newbies assume that you're running the default as far as I can tell.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jun 13, 2003, 08:37 PM
 
Originally posted by tru322:
Well I'm running the default 10.2.6 shell (tcsh???) so how would I go about setting the classpath in that?

Oh and seeing as I should probably trying to learn how the UNIX shell works (mainly so I don't go screwing everything up too badly) what exactly is the classpath and what does it do?
Not sure WHAT the default shell is. If you're using csh or tcsh, set verialbles like this:

Code:
setenv CLASSPATH "${CLASSPATH}:/Library/Java/xalan.jar:/Library/Java/xml-apis.jar:/Library/Java/xercesImpl.jar"
Classpath is not a UNIX thing, it's a java thing. Learn more about it here:

http://www.kevinboone.com/classpath.html
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
tru322  (op)
Fresh-Faced Recruit
Join Date: Aug 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 14, 2003, 05:51 AM
 
OK, thanks Arkham_c.

How do find out which shell I'm running then?
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jun 14, 2003, 07:10 AM
 
Originally posted by tru322:
OK, thanks Arkham_c.

How do find out which shell I'm running then?

Code:
[arkham@flybook ~] ps PID TT STAT TIME COMMAND 632 std S 0:00.06 -bash (bash)
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Forum Regular
Join Date: Jul 2002
Location: Australia
Status: Offline
Reply With Quote
Jun 14, 2003, 10:37 AM
 
As I've mentioned in the Developers forum before, putting .jars in /Library/Java/Extensions automatically adds them to the classpath without any further modifications.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jun 14, 2003, 10:22 PM
 
Originally posted by asmodeus:
As I've mentioned in the Developers forum before, putting .jars in /Library/Java/Extensions automatically adds them to the classpath without any further modifications.
Good to know. Found that documented here as well:

http://developer.apple.com/qa/qa2001/qa1170.html
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
tru322  (op)
Fresh-Faced Recruit
Join Date: Aug 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 18, 2003, 04:53 AM
 
Cheers guys, got it all sorted now. Pretty easy when you know how

Asmodeus, that tip on where to stick the .jars worked a treat and Arkham_c, cheers for the link and by the way the default shell appears to be tcsh.
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 11:33 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2