December 17, 2011

Java on Linux - notes from 2011

There are so many choices, and so much lingo.

The first choice is deciding what you want to do with Java. There are in general 3 sorts of Java users:

The majority of people are probably the of the first sort, people who just want to be able to run the Java applets that pop up now and again on the web. This requires a Java plugin for your browser. At one time there was thinking that Java would rule the world and Java would be like hot and cold running water, built into every browser. This has not taken place.

It it important to clarify the distinction between applets and applications. Applets are java programs that are hosted on websites and run within a browser. Applications are programs which are intended to run like any program, entirely independent of a browser. I note for completeness that there is a utility used by developers to run applets outside of a browser.

Using Java

The rest of this document discusses the often times tricky process of getting Java installed on your computer. The following link is intended to get you started using java once that has been done.

Setting up for Java Development

Java is different from virtually every other interpreted language because it is "compiled" (loosly speaking). This requires you to use a two part process, just like a real compiled language like C. This also leads to two part packaging. if you only want to run java, not develop java code, you probably just want the java runtime (the JRE as sun/oracle calls it). If you want to develop code, you want the software development kit (the SDK), which includes the JRE. Note that this SDK versus JRE lingo is jargon used only by oracle/sun.

Regardless of whether you are an end user or a developer, you are also faced with a choice of java distributions. On top of that, you also need to choose the version of whatever distribution you settle upon. If you are just beginning to work with Java, you are in no position to make an informed choice.

The mainstream choices are as follows:

You won't go wrong installing the latest Java from Oracle/sun, but it will be more work, and won't be managed by your package system. The fedora project people recommend installing OpenJDK unless it is known to have some inadequacy for what you are doing, but this leaves a lot of people feeling nervous and expecting such an inadequacy to be lurking and bite them at the worst possible moment.

I am not sure what role the Gnu Java compiler (gjc) plays in the current Java game. So far I am ignoring it, but it is there for you to screw around it if you want.

Take a look at the Fedora Java FAQ. If you are running some other distribution besides Fedora, I won't be able to offer specific help. I am still struggling to sort out the options under Fedora.


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org