How should I move over to Java programming?

I have been involved with programming as a hobby for around five years and know the field quite well. Java seems to be one of the major demands here in Estonia and since I wish to find a job as a programmer in the near future, I figured I might as well pick it up.

However, I know very little about Java development. I know C++ and C# and quite a few other languages, so the Java language itself will definitely not be a problem but I know nothing of the SDKs and IDEs used with Java.

What are the IDEs? Free ones? Pay ones? What are good and what are bad?
What SDK should one use for developing Java software for cellphones?
What are the main libraries used with Java? For networking, xml, graphics (is there a DirectX library/wrapper for Java or something similar?) and others?
What about GUI libraries? I seem remember hearing that Java was not that good at windowed UIs - is that true?
How is debugging done? What are the best debuggers?

What more should I know? Any especially tricky aspects about the language itself?

Java is a good language. It is easy to debug, easy to

The best IDE, by far, is Intellij IDEA. In fact, I think a large part of my preference for Java is due to the lack of a comparable IDE for other languages. It is rather expensive, though: anywhere from $100 to $500, depending on whether you buy an academic, personal or commercial license.

Eclipse is a free, open-source IDEA clone (people describe it as bizarro-IDEA). I hate it, but it is quite popular.

J2ME is what is used on cellphones - it standards for Java 2 Micro Edition, as opposed to J2SE (Java 2 Standard Edition) or J2EE (Java 2 Enterprise Edition). I don’t know that much about it, though.

There are an enormous number of libraries built into J2SE and J2EE. Everything from XML to networking to 2D graphics to 3D graphics. I’d recommend browsing the documentation at http://java.sun.com if you’re looking for something specific. I don’t know about DirectX wrappers - that would be kind of pointless, as Java is cross-platform and DirectX is not.

If you are unhappy with, or can’t find a feature in the included libraries, chances are there’s a third-party library somewhere online that does what you want.

Java’s primary GUI library is called Swing. People who don’t know what they’re takling about like to bash it, but I find it well-designed and easy to develop with. It is rather ugly by default, but that’s easily changed.

I have never felt the need to debug with anything other than print statements and stack traces, but IDEA has an excellent debugger built in.

The language itself is intentionally quite simple. If you know C++ well, you will have no trouble learning it.

I agree. If programming in Java, you really must get IntelliJ IDEA. It’s hands down the best IDE I’ve ever used. Eclipse is free, but has some strange quirks and can be infuriating to work with at times.

If you are going to do much visual Java I recommend JBuilder from Borland.

Eclipse (free, and widely used in the US), Oracle JDeveloper (free, but bloated), JBuilder

The main editions of Java are
J2SE - standard edition, for writing Java you’d run on your local workstation
J2ME - mobile edition, for cellphones, PDAs, and other limited platforms.
J2EE - enterprise edition. A misnomer, it’s really nothing more than the API for developing web-based applications.

The Java architecture uses .jar files containg class libraries. You get most of them with Java itself. For example, the JNI (Java Native Interface) library allows you to use OS-dependent calls. I don’t know about DirectX. Do a Google search on Java <whatever> and you’ll probably find libraries.

Used to be very true. Not so true any more, now that Java Swing replaced the earlier Java AWT. Java GUIs are not Windows GUIs, mostly because the Java architecture doesn’t allow you to tie your app too closely to a particular platform.

Add-ons to J2EE such as JSPs, Struts, and Faces make Java quite good for enterprise-level web application GUIs.

Most debuggers are built into the IDE.

Define tricky! I think Java is much easier to use than C++. I don’t know C# that well, so I can’t comment. Much of what Perl, Python, and Ruby do as part of the language, Java does as an API call, so if you know those languages, Java may appear to be more tedious.

Despite Java’s claim to be platform-independent, Java apps don’t always work perfectly when you take them from your development platform to another one. Java is also very dependent on path and class-library settings.

I think the best thing about Java is the vast library support that is fairly well-documented. As others have said, just about everything you need is in J2SE.

For gaming based on J2SE, there are a lot of libraries available: Open GL bindings are in JOGL. Open AL bindings in JOAL. There is the Lightweight Java Game Library and Skinny Puppy game library (somewhere on Source Forge). You can also write games directly using Java’s 2D graphics library.

The Jakarta website has a ton of great libraries including networking and XML. I really like their xmlbeans library for XML processing (but it is probably too big for J2ME devices). Java has built-in support for XML processing (SAX and DOM). I think the default implementation is xerces from Apache. The nice thing that Sun drives for a lot of library support is to specify interfaces and let vendors/open-source create implementations that fill the interfaces. This can make it possible to switch libraries without rewriting code. Other good library sites are dev.java.net and sourceforge.net.

Of course, for mobile development, as others mentioned, you’ll want J2ME. This is an overview of what is in J2ME. Cellphone vendors might have specific SDKs too (and these might include custom graphics/sound libraries).

For IDEs, I really like Eclipse. It is full-featured, free, a bit sluggish, and development on it has been moving very quickly.

Also, here’s an article on Java SDKs for mobiles.

Java did get a bad rap for GUIs, but this applies to desktop apps which can be pretty GUI-intensive. I wouldn’t think there would be any problem on mobiles. They should have enough horsepower to display basic GUIs (which is about all you would use on mobiles).