Take the 2-minute tour ×

Mid-level PHP programmer here.

I plan on teaching myself Java. I'm already familiar with the basic concepts like MVC, ORM's etc.. so I'm not a beginner programmer. As such, I'm looking for the best way to begin familarising myself with the nuances of a languange I am inexperienced with.

For starters, I have begun coding up a simple login/logout mechanism using JSP and have enjoyed making some decent progress.

So, my question to any and all Java gurus:

What aspects of Java should I delve into first? My plan is currently to continue with a simple app in JSP, then introduce Spring and Hibernate before moving onto concurrency and Swing.

If you had to re-learn java from scratch, what path through the different technologies and concepts is the best to take?

share|improve this question

migrated from stackoverflow.com May 23 '11 at 14:35

This question came from our site for professional and enthusiast programmers.

avoid Swing like the plague. –  Woot4Moo May 23 '11 at 17:05
If you're in a situation to debug with some tips from an experienced Java dev, debug. Best way to pick up basics in any new language, IMO. –  Erik Reppen Nov 26 '13 at 8:51
add comment

6 Answers

up vote 6 down vote accepted

My advice is to pick a small, manageable project in an area that you actually care about (so you have the maximum motivation!), and use this as a forcing device to learn the related set of skills. Some examples:

  • If you want to learn how to write desktop apps (e.g. with Swing) then maybe try implementing a simple game like MineSweeper. This will teach you all about Swing UI design and user interaction, plus you will need to solve practical problems like access graphics resources or saving high score tables to disk etc. If you want to get fancy you also have plenty of opportunities to explore concurrency here (animations, timers, etc.)

  • If you want to learn to write Web Apps, I'd strongly recommend writing your own minimal web application using the Servlet API (this is what JSPs actually use under the hood). This is a good learning experience and helps you really understand how Java web applications are actually working. Here's a quick servlet and JSP tutorial that may be helpful.Once you've learnt the basics then you can move on to one of the more advanced frameworks (maybe something like Vaadin?)

  • If you just want to learn the core language, maybe try something that forces you to write a variety of algorithms and data structures. Maybe implement your own custom tree data structure in a way that conforms to the Java collections API? Or maybe try some of the Project Euler challenges if you are more mathematically inclined?

One extra word of advice: you will never be able to learn all the Java libraries and APIs as there are so many, so don't bother even trying. Instead, learn the core principles of the language, common design patterns and the 3-4 libraries you really want to use regularly. Then you can always Google/use StackOverflow to solve other problems or explore new APIs on an as-needed basis.

share|improve this answer
Great advice, thanks. –  Evernoob May 23 '11 at 14:57
thanks for the reference to Project Euler. That looks like fun. –  temptar May 23 '11 at 15:06
add comment

The Collections API http://download.oracle.com/javase/tutorial/collections/index.html and the tutorials on Oracle. Try to learn Spring http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ as soon as you understand the language and syntax. Look into using Annotation based config instead of XML. You may already understand the power of using JSON and REST Based interfaces, but I'd definitely look into doing data based services in Spring instead of just returning markup or doing things in JSPs.

share|improve this answer
add comment

If you want to do web development in Java you need to be intimately familiar with the Servlet API since almost all web frameworks build on top of this.

The official tutorial is at http://download.oracle.com/javaee/6/tutorial/doc/bnafd.html (it is a bit on the heavy side), which I would suggest you have a closer look at.

share|improve this answer
add comment

Try to find a job as Junior Java developer and continue learning the language on your own.

share|improve this answer
Not really feasible to quit my nice paying job and getting a junior position. Thanks though. –  Evernoob May 23 '11 at 14:56
I'm happy for you. Then an open-source project would be a way to go. Pick one, check it out, try to build it, change a bit, take a look at the issue tracker, fix an issue, send a patch, become a commiter. –  Boris Pavlović May 24 '11 at 6:47
Why? Please elaborate. –  Dynamic Aug 14 '12 at 4:14
add comment

Before being able to recommend a certain path, it's probably important to know that you are looking at Java not just as a language, but also as an architecture - so you'll also want to focus your efforts on the architectural parts that you might find useful. (You've already done that by starting with JSPs.)

To echo a few other answers, there are a few good starting spots:

a) Servlets/JSPs - you're obivously part of the way here, but focus a bit on the container philosophy of J2EE.

b) Do some database persistence - you've probably done a JDBC method, but you might want to understand a bit about EJBs and the rest of J2EE (download JBoss or GlassFish).

c) Take a look at "Java Server Faces" for web development using either ICEFaces or Apache MyFaces. JSF is a standard view layer, and is quite a bit different from JSP/PHP methods for doing web layout. Understand how a model-view-controller framework corresponds to similar ones in PHP. (like CakePHP.)

Also note how 'layouts' work and are a bit different than pure HTML/CSS methods.

... that would probably be a good intro to Java as a 'web' language; it might get you started professionally, but also leave you with plenty of room to scratch a few itches.

share|improve this answer
Actually it's good to learn that there is a split in the Java EE world. On one side is architectures based on Jboss, EJB, JSF, etc. and on the other is Spring/tomcat/hibernate etc. They're two ways of doing the same thing and most people don't learn both. –  Kevin May 23 '11 at 16:27
add comment

I also come from a PHP background and recently retaught myself Java after having not used it for several years. I read two companion books: Murach's Java SE 6, and Murach's Java Servlets and JSP 2nd Edition. The way these books are structured allowed me to finish both in a matter of weeks. I can't imagine a simpler way of re-learning the language, and exposing myself to the Servlet API for the first time.

In addition to that, an important way to learn the in's and out's of Java is to familiarize yourself with API documentation. Here are the docs I found most helpful (some may be repeats found in other answers):

share|improve this answer
add comment

Your Answer


