How do i write java on a mac?

Discussion in 'Mac Programming' started by HomeingPigeon, Oct 23, 2007.

  1. macrumors regular

    Joined:
    Aug 1, 2007
    #1
    For my class I will get extra credit if i can figure out how to write java and run java on a mac. I know it is possible and I hope that someone can tell me how they do it. The fewer things I have to download the better and the less money that it cost the better as well


    thanks
     
  2. macrumors G4

    Joined:
    Mar 4, 2006
    #2
    Java is built into OSX. More info here
     
  3. thread starter macrumors regular

    Joined:
    Aug 1, 2007
    #3
    Yeah i know that it is built in but how do i access it and write it.
     
  4. macrumors G4

    Joined:
    Mar 4, 2006
    #4
    Have you installed the XCode tools? The Java Development apps are bundled with them. They aren't installed by default, but are on your OSX installation disks.
     
  5. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #5
    If you have broadband its probably best to download the latest version of the developer tools with a free developers account on http://developer.apple.com/. Though the method dynamicv will work fine, and save you a 900MB download.

    Once you have installed the developers tools. You can then compile with javac and run with java just like on Windows/Linux.
     
  6. cjh
    macrumors newbie

    Joined:
    Oct 23, 2007
    #6
    If you only need to prove that you can write, compile and run java on a Mac, then you can just use TextEdit to make your java source (set it up to use plain text instead of rich text), compile using javac, then run using java.

    I don't recall if javac is installed with OS X or if you have to install it via developers tools (either off your OS X dvd or from the download mentioned above).

    Alternatively, you can use XCode, also mentioned above, or other available IDEs for java available for Mac like Eclipse or NetBeans.
     

Share This Page