• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java on os x (very beginning)

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
open a command shell and try "which javac".
Should tell you where the compiler is located.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavRanch.

Bookmark this page. Lots of good information about Java on OS X.
 
Scott Walker
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Scott Walker
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem solved.....thanks guys. its nice to see a forum that doesnt stick its nose in the air at newbies. Thanks again.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We love newbies! Welcome to the Ranch!
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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


Especially Mac users!
 
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic