I would like to learn java. The books listed in the previous posts seem outdated. Can anyone recommend an up to date java book. There seems to be many java versions, if that is the correct term of course, such as jdk 5, jdk 6 etc. Which one is good to learn.

If you referring to http://www.daniweb.com/software-development/java/threads/99132 then that yes, some of them are out of date because post was originally created in 2007.
However it still holds ground with titles like Head First Java or Java How to Program from Deitel & Deitel.
Head First Java will give you very good ground up explanation of Java basics. Java How to Program will give you introduction to Java and it will take you through various areas like GUI development, applets, database connectivity, basics of Java web development.

The current version of Java is Java 6, confusingly version numbered as 1.6. There's no reason to work with any earlier version unless you are specifically required to do so.
(Java 7 / version 1.7 is due out later this year, but doesn't add much over 1.6.)
Anything you find for 1.5 will be good for 1.6 also, but beware of code written for earlier versions (mostly 1.4.2) because there were major improvements to the language in 1.5.

I have Sams Teach Yourself Java 6 in 21 days, but I just use it as a quick reference,but I'm sure you can use it to learn. It may be difficult, and it definitely wont take you 21 days to learn, but you will learn it eventually.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.