Java Compiler for OS X?

Discussion in 'Mac Apps and Mac App Store' started by jamdr, Feb 2, 2004.

  1. jamdr macrumors 6502a

    jamdr

    Joined:
    Jul 20, 2003
    Location:
    Bay Area
    #1
    Does OS X come with a Java compiler? If not, does anyone know where can I get a compiler? Thanks.
     
  2. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #2
    It's part of the developer tools disc that comes with every copy of Mac OS X or pre-loaded onto new machines.
     
  3. jamdr thread starter macrumors 6502a

    jamdr

    Joined:
    Jul 20, 2003
    Location:
    Bay Area
    #3
    Yeah, thanks. I just realized that it should be on my computer, but I did a custom install and didn't install the Developer Tools. I tried to install them from Restore CD, but it won't let me add something, I would have to erase my current system and install it all over again (or archive it). Is there a way I can just install it on top of my current system?
     
  4. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #4
    Are you sure that you don't have an installation folder within the Applications folder? That's where they were on my system from the restore CD-ROMs.

    The only other solution I can imagine is that I hav e an extra CD-ROM with tools that ADC just sent me, so if you need the one I got with Panther, you're welcome to it.
     
  5. jamdr thread starter macrumors 6502a

    jamdr

    Joined:
    Jul 20, 2003
    Location:
    Bay Area
    #5
    Thanks for your response. I had reinstalled my system earlier, and so didn't have that install folder, but my friend had it on his iBook so I installed it from there. But now that I have XCode, I can't figure out how to run a simple Java class. I don't want to create an entire application, I just want to test a few lines of code. Is this possible in XCode? I'm not used to Mac programming at all, so I would just like to try some things before I create a project. Is there a way to compile and run just one class?
     
  6. cubist macrumors 68020

    Joined:
    Jul 4, 2002
    Location:
    Muncie, Indiana
    #6
    1. Put the developer tools disk in and double-click the installer.

    2. You don't need to use Xcode to compile a few lines. Just use vi and javac in Terminal, like any normal Unix computer.
     
  7. MongoTheGeek macrumors 68040

    MongoTheGeek

    Joined:
    Sep 13, 2003
    Location:
    Its not so much where you are as when you are.
    #7
    Or TextEdit and javac.

    IfI could remember the extension and other java thingies I would test a theory that all you would have to do is write it in TextEdit and double click.
     
  8. jamdr thread starter macrumors 6502a

    jamdr

    Joined:
    Jul 20, 2003
    Location:
    Bay Area
    #8
    Wow, javac, that's obvious. Thanks. I keep forgetting OS X even has a terminal. This is going to take a while to get used to.
     
  9. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #9
    Where is a good tutorial on using Xcode to write HelloWorld in Java?
     
  10. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #10
    Actually, if you just open Xcode, create a new Java tool project, that should take care of everything, including the "Hello World!" code.
     
  11. janey macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
    #11
    reading this thread, i remembered an email I got from the studentdev mailing list, this guy was asking what a good and free c++ compiler was. :)
    It was pretty funny sorta, because I burst out laughing because of the absurd question. Sounds like most people in there don't know what gcc is, they're just saying you can use Xcode/Project Builder to do it.

    http://lists.apple.com/mhonarc/studentdev/msg10901.html
     
  12. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #12
    Well, really, you could replace gcc with any other compiler and have Xcode call it when compiling code and most developers wouldn't notice on small projects. ;)

    Sun's Java compiler can be replaced with IBM's jikes just fine too.
     
  13. jdb791011 macrumors newbie

    Joined:
    Sep 10, 2009
    #13
    Java Compiler in Terminal?

    Hey, can someone explain to me how to compile a .java file I have already coded so that it can run as executable on my desktop (or anyone else's desktop for that matter). I coded it in NetBeans, it runs fine. But now I want to make it a .app like the other programs on my OS X. Thanks. Appreciate it.
     

Share This Page