Java Question

Discussion in 'Mac Programming' started by damgpro, Jan 25, 2005.

  1. macrumors member

    Joined:
    Aug 25, 2004
    Location:
    nyc
    #1
    Hey I'm a computer science major and I've just started my programming 1 course and we're using Java. My professor wants us to be using JDK 5, what JDK is with XCode? If it isn't 5 is it compatible?

    Thanks!
     
  2. macrumors 6502a

    jamdr

    Joined:
    Jul 20, 2003
    Location:
    Bay Area
    #2
    Apple has decided to release Java 5 along with OS X Tiger, and not before for some reason. So the Java version that comes pre-installed on Macs with Panther is 1.4.2. I've heard that the Java 5 beta that comes with OS X Tiger beta will work just fine on Panther, though, if it's that important and you want to try to get your hands on it.
     
  3. thread starter macrumors member

    Joined:
    Aug 25, 2004
    Location:
    nyc
    #3
    Thanks for the info jamdr, guess I'll have to do the work on my PC for class :(
     
  4. macrumors 68040

    cluthz

    Joined:
    Jun 15, 2004
    Location:
    Norway
    #4
    Yeah it sucks!

    Java 1.5/5.0 has been available for Win and linux/x86 for 6 months...
    I have to use java 5.0, so have to compile and run my apps on a crappy P3/400MHz machine (from Remote dektop on my powerbook...).

    Apple is really shutting out java developers!

    I mailed apple developer connections about Java 1.5/5.0 progress, but since I "only" have the $100 student account and not the $500 regular account they wouldn't discuss it. They said it isn't their policy to talk about unreleased programs!

    I actually bought my powerbook because I needed a portable java production machine. What a waste!
     
  5. macrumors 6502

    Joined:
    Sep 4, 2001
    Location:
    West Sussex, UK
    #5
    If you write your code under Java SDK 1.4 on Mac OS X there should be no problem getting it to compile with Java 5. However the older version of the language lacks some of the features of the new version but this will probably not matter for an introductory programming course.

    I really wish that Apple would hurry up and release Java 5 for Mac OS X. The delay before every major Java release on the Mac must be causing people to not consider buying Macs. Fortunately for Apple it will take developers quite a while to move to the new version since the installed base is still so small. At work I've just started a new Java project using SDK 1.4 and SWT. I won't consider Java 5 until its supported properly in SWT, and even then, I'm not a big fan of many of the new features. Although generics and no typecasting are great.
     
  6. macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #6
    Actually, you may run into problems. I've heard/read that Jave 1.5/5.0 simplified File IO so no more BufferedReader(new FileReader(File)), just a single level that accesses the file.

    As for basic Java development on the Mac, I have found XCode to be like shooting a nuke to kill a fly. For basic Java dev, I would use Eclipse, and for simpe coding take a look at BlueJ. They should both come up if you search for them over at versiontracker or MacUpdate.
     
  7. macrumors 68040

    cluthz

    Joined:
    Jun 15, 2004
    Location:
    Norway
    #7
    There's acutally many new features that makes Java 5.0 much easier and better than the 1.4.2.
    Things like automatic boxing and unboxing makes a huge difference.
    Also the new Scanner class is making reading input from a terminal/xterm much easier, this is very important for learning java. The tables are much better too. Static import (oh yeah! never have to type System.out.println...), enum.. etc...
    There are many things that makes java much easier to learn, therefore many programming classes have switched to java 5.0.

    Also Mac is the only large platform that doesn't have java 5.0..
     
  8. macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #8
    What are you using that's specific to Java 5? If you're just doing an intro-level course, I doubt there's anything you'd do in 1.4.2 that won't work (or works differently) in 5.

    If nothing else, you can use the Apple tools and copy them over to your PC to make sure that they build w/ Java 5. You could also setup a Virtual PC w/ Windows 2000 and test your code that way.

    HTH.
     
  9. thread starter macrumors member

    Joined:
    Aug 25, 2004
    Location:
    nyc
    #9
    Thanks for all the suggestions everyone. I'm prolly going to do as ChrisBrightwell stated and write the code on my mac and then compile it on the PC, or perhaps through Virtual PC or remote desktop connection. I found out that the main reason for using Java JDK 5 in my class was for the new scanner class that cluthz mentioned.

    Thanks again!
     
  10. macrumors 6502

    Joined:
    Sep 4, 2001
    Location:
    West Sussex, UK
    #10

    BufferedReader/BufferedWriter and FileReader/FileWriter are both still there and have no sign of being deprecated. There would be simply no reason to remove these extremely useful classes.

    I find Eclipse to be a much better Java editor than Xcode is. Hopefully Apple is going to make Java a firstclass language with Xcode 2, because just now Xcode is really for C/C++ and Obj-C.
     
  11. macrumors 68040

    cluthz

    Joined:
    Jun 15, 2004
    Location:
    Norway
    #11
    BufferedReader isn't removed, but Scanner will make some things much easier than Buffered reader did.
     
  12. macrumors 65816

    MacFan26

    Joined:
    Jan 8, 2003
    Location:
    San Jose, California
    #12
    Oh yeah, definitely Eclipse. I'd even recommend it over NetBeans, which I used to like a lot better. Eclipse isn't the most friendly app, but it's pretty much the same when going back between Mac and PC, which is nice in a school environment where the labs only have PCs...
     

Share This Page