PDA

View Full Version : Java Question




damgpro
Jan 25, 2005, 10:29 PM
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!



jamdr
Jan 25, 2005, 11:49 PM
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.

damgpro
Jan 26, 2005, 12:23 PM
Thanks for the info jamdr, guess I'll have to do the work on my PC for class :(

cluthz
Jan 26, 2005, 12:43 PM
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!

iJed
Jan 26, 2005, 01:08 PM
Thanks for the info jamdr, guess I'll have to do the work on my PC for class :(

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.

stoid
Jan 26, 2005, 01:20 PM
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.

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.

cluthz
Jan 26, 2005, 01:39 PM
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..

ChrisBrightwell
Jan 26, 2005, 02:49 PM
Thanks for the info jamdr, guess I'll have to do the work on my PC for class :(
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.

damgpro
Jan 26, 2005, 04:59 PM
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!

iJed
Jan 27, 2005, 02:59 AM
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.


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.

cluthz
Jan 27, 2005, 11:46 AM
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.

BufferedReader isn't removed, but Scanner will make some things much easier than Buffered reader did.

MacFan26
Feb 1, 2005, 06:35 PM
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.
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...