*
The moose likes Mac OS and the fly likes java on os x (very beginning) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "java on os x (very beginning)" Watch "java on os x (very beginning)" New topic
Author

java on os x (very beginning)

Scott Walker
Greenhorn

Joined: May 31, 2006
Posts: 12
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
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: 42277
    
  64
Welcome to JavRanch.

Bookmark this page. Lots of good information about Java on OS X.


Ping & DNS - my free Android networking tools app
Scott Walker
Greenhorn

Joined: May 31, 2006
Posts: 12
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: 42277
    
  64
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
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
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: 42277
    
  64
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.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

marc is correct -- you should just be able to bring up a Terminal window and type javac at the command prompt.

What happens when you try that?

If it's not working, you may need to install the Developer's Tools from the Tiger (is that what you are using?) DVD.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Scott Walker
Greenhorn

Joined: May 31, 2006
Posts: 12
problem solved.....thanks guys. its nice to see a forum that doesnt stick its nose in the air at newbies. Thanks again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

We love newbies! Welcome to the Ranch!
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Bear Bibeault:
We love newbies! ...

Especially Mac users!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java on os x (very beginning)