Java

Discussion in 'Mac Programming' started by MeanD3feat, Feb 5, 2005.

  1. macrumors member

    Joined:
    Jan 31, 2005
    #1
    OK previously I was working with a PC using textpad for java, but now I don't have a PC and I would like to continue learning Java. I understand that somewhere in 10.3 there is a Java "thing" (in case you haven't noticed the classes haven't really sunk in but I have the literature so I would now like to self teach) where I can write my Hello World program :rolleyes: , but I can't find it!
    Yes I realise this is a VERY basic question, but everyone has to start somewhere ;)
    Any help would be appreciated :D
    Also is where I do the typing compile etc the console? :confused:
    Thanks
     
  2. macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #2
    Did you install the Xcode developer tools? You'll need to to get the Java SDK. You should either have an Xcode CD or you can download it from the Apple developer site. Make sure you get the latest version, as it needs to match up with the Java runtime that's already installed as part of the base OS.
     
  3. macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #3
    65816

    Hey! I finally made it from 6502 to 65816!
     
  4. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #4
    OK it was all on the Hard Disk waiting to be installed, just for the record, OS X takes much longer to boot now. Before when the silver apple logo and progress bar came up I would see the bar reach two thirds and no writing was displayed, then I would get the desktop and be ready to go. Now I have to watch the whole bar fill and wait a few seconds after the desktop appears before I can do anything-not a problem (I hope) but just thought I would mention it!

    OK like I said, it is installed now and I have a folder called developer. Where do I go from here? :confused:

    Also
    Congrats, not quite sure what that is all about, but you seem pleased :)
     
  5. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Try heading here: http://developer.apple.com/
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Java SDK is built into Mac OS X, along with the rest of J2SE. You don't HAVE to install Xcode to get started, if you don't want to.
     
  7. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #7
    Err too late! :(
     
  8. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #8
    Can anyone point me in the direction of what i think is called the console? I think that is what I am looking for, the screen where I input the code and then see if it compiles, and then run. Like I said I used textpad previously, and found that good because it colour coded everything and inserted tabs for me.
    So far I have installed Xcode and have had a look at the link posted above but it appears to be about 0S 8.
    Thanks for all the help so far, this has to be the fastest responding forum I have ever been a member of, pure class :D
     
  9. mms
    macrumors 6502a

    Joined:
    Oct 8, 2003
    Location:
    CA
  10. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #10
    I can see terminal, but I have no idea what to do next. Is there any app on the Mac similar to textpad? I am at the stage of rolling around on my back as far as java is concerned; I'll hopefully be crawling soon, but walking is a long way off, and you know what they say, you've got to crawl before you can walk!
    So any instructions really do have to be basic, honestly the simpler the better-I wont be offended! :D

    EDIT: Like TextMate

    Is there a way after writing a java program (such as hello world :p ) with textmate to get it to compile and run? I can't find an option anywhere! I know with TextPad you had to install a plugin, but I wouldn't know where to start with this program.
     
  11. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #11
    I'm currently downloading Netbeans to see if that is what I'm after. In the meantime, thanks for all the help and I'll let you know how I get on.
     
  12. macrumors regular

    Joined:
    Oct 27, 2004
    Location:
    Essex, United Kingdom
    #12
    open the Developer folder, in there, open the Applications folder then open Xcode
    ("/Developer/Applications/Xcode")

    Then from the file menu, choose new project, and scroll down and you'll see options for JAVA programming.

    Enjoy.
     
  13. macrumors 6502

    Joined:
    Jul 29, 2004
    #13
    Proabaly not exactly what you are looking for, but when I did my "Hello world" I did it all from Terminal. You should learn two things:

    1. vi -- vi is a text editor, but read the man page first if you have never used it.

    2. you can compile right from the shell prompt. The command is 'javac' Also worth a man page reading.

    That should be enough to make you just a bit dangerous. Some googleing should help you out too.
     
  14. macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #14
    My bad, then. I always install Xcode when I install the OS, so I have no way of telling when the SDK is installed. I thought the basic OS install only gave you the JRE. It seems a bit odd to me to install the Java SDK, but no other development tools. Why should Java be "special"?
     
  15. macrumors 65816

    devman

    Joined:
    Apr 19, 2004
    Location:
    AU
    #15
    You really don't need it but if you want to go that route you should look at eclipse also. Xcode 1.5 is the native IDE and it supports Java development (earlier versions of Xcode do as well, but 1.5 adds what many consider the essentials).
     
  16. thread starter macrumors member

    Joined:
    Jan 31, 2005
    #16
    ok, but i actually don't know what to do with Xcode once it is running! I can type obviously, but that is it really. I dont get indents or colours and i wouldn't know how to compile or run anything. Though to be fair the problem here is between the keyboard and the mouse! ;)
     
  17. Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #17
    Or consider using TextEdit (in the applications folder somewhere) or pico ... vi is good but not necessarily for the faint of heart. ;)
     
  18. macrumors 6502

    Joined:
    Mar 10, 2004
    Location:
    North and east of Mickeyland
    #18
    Yeah, Eclipse does work nicely in OS X and it might be a good environment if you are learning Java. It might seem a bit cumbersome at first (feature rich) but once you figure out the basics (where to go to build, run, configure runtime options/classpaths for your programs, etc.) you should be able to program and run pretty quickly.
     
  19. macrumors 65816

    devman

    Joined:
    Apr 19, 2004
    Location:
    AU
    #19
    Make sure it's Xcode 1.5. I'm pretty sure that's the version that added Java syntax awareness, etc. to the editor.

    If not that, then go get a book. There's several good OS X programming books that cover Xcode. There's also a Java for OS X book from O'Reilly. Or do a google on java and xcode. Here's a first page hit I got - scroll down and you'll get a very simple walkthrough to get you started.

    http://moss.utsa.edu/MAX/CSHomework.html
     

Share This Page