Thursday, September 01, 2011

Recipe#2: To Start Developing In Java

To start any Java project, you need to install a Java Development Kit (JDK) on your computer. The kit contains the virtual machine (JVM), the language spec, and a number of other utilities. Only three things need be done to properly install a JDK:
  1. Download the latest J2SE from http://www.oracle.com/technetwork/java/javase/downloads/index.html and run its installer.
  2. Configure the environment variables so that your installation is available on the system classpath. In either PATH or CLASSPATH, add %install_directory%\bin. At the commandline, you should be able to run java -version and see version information.
  3. Create a JAVA_HOME system environment variable and point it to the directory where the JDK is installed. Plenty of Java tools, plugins, applications, and utilities expect this variable to exist.
At this point, you can start developing Java code (using any text editor and the shell/commandline). A word of caution: although Java SE7 has some great new features, some have observed a few drawbacks. Ref: "Java SE 7 'Buggy,' Causing Crashes Says Apache Lucene".