Hi everyone, im tryin to learn java......im at the very beginning, ive been told i have java already on my os x 10.4, but i cant find the SDK. Does anyone know what im looking for? Thanks guys and sorry to post such a newbie queston.
Jeroen T Wenting
Ranch Hand
Joined: Apr 21, 2006
Posts: 1847
posted
0
open a command shell and try "which javac". Should tell you where the compiler is located.
42
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
7
posted
0
Welcome to JavRanch.
Bookmark this page. Lots of good information about Java on OS X.
by command shell do you mean in terminal? If so, it says usr/bin/javac........but i dont really know what this means.
Any help would be appreciated, i am truly right at the beginning haha.
thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
7
posted
0
Terminal provides a command line, so, yes, you can use that. There are others, which are -IMHO- better (e.g. iTerm), but Terminal works just fine, so at the beginning you should stick to it.
What that tells you is that all java executables (javac, java, jar, javadoc, ...) are installed and available. You can run "java -version" to find out which version of the JVM you have (on 10.3 it could be 1.3 or 1.4, on 10.4 it might 1.4 or 1.5/5.0).
Another interesting directory is /Library/Java/Extension, where you can place additional jar files so that they are available to all Java programs.
The javadocs are in /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Resources/Documentation/Reference/doc/api on my machine. Depending on which JVM you have it might be in a slightly different directory on your machine.
Jeroen T Wenting
Ranch Hand
Joined: Apr 21, 2006
Posts: 1847
posted
0
Originally posted by Ulf Dittmer:
Another interesting directory is /Library/Java/Extension, where you can place additional jar files so that they are available to all Java programs.
I'd not recommend that though. It can quickly lead to very serious problems if you put something there and then a Java application you install requires its own different version of that library and crashes. Or you forget you put something there, write something that needs it (which now works fine on your machine), and forget to distribute that library to your users.
Better use explicit classpaths to launch your applications, possibly in conjunction with shellscripts so you don't have to type them in all the time.
Scott Walker
Greenhorn
Joined: May 31, 2006
Posts: 12
posted
0
i tried following this .....The javadocs are in /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Resources/Documentation/Reference/doc/api ......but i get classes.nib info.nib and objects.nib.......none of which i can open. Will the compiler be labelled java sdk? Sorry to keep bugging you guys with such early problems.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
7
posted
0
That's strange, I have the usual HTML files in that directory. Keep poking around in that directory vicinity, they gotta be there somewhere.
The compiler is called "javac", and is in the directory /usr/bin, as you have established earlier running the "which" command.
Scott, I'm wondering why exactly you're looking for the SDK location. Java should be installed and ready to go on the Mac. Are you having problems compiling or running? Have you run a "Hello World" program?
Also, we have a forum specifically for Java on Macs, so I'll move this thread there for you. Please continue this discussion there.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org