Setting up to brew some Java (on Windows)

Here’s what we’re going to do:

  1. Download the basic Java tools (the JDK) and install it.
  2. Verify that it works.

Frog hidden amongst the algae

Updated on 2011/8/20

This series is intended as a beginner’s guide for getting started creating a desktop application using Java – on Microsoft Windows. It is not intended as a lesson in how to program; it’s simply a road-map for setting up the minimum software on your computer to start writing code and running it. I posted this because the online information that’s readily available seems to be a mess. Even on the main Java websites, some of the information is outdated, wrong, unclear or just poorly written. I think it’s especially important to have this be simple, easy, and correct for beginners.

I’d appreciate your feedback comments for improving this article.
Unlike C# or even C++, it can take a bit of scrounging to get setup to produce a decent Java desktop application. Here then is a list of tips for getting started. Please note that these apply only to development under Microsoft Windows (as of 2011 I’m using Windows 7): if you’re using a different operating system then you’ll need to make allowances for the differences. Also, for brevity – I’m simply going to assume you’re working with the current version (as of 20th August, 2011) which is Java 7. If yours is a different version then just allow for this as you read below.

Okay, let’s get started!

Download the Java JDK and install it.

First off you need to download and install the Java JDK (“Java Development Kit”). Assuming you want the latest release, download it from here:  http://java.sun.com/javase/downloads/?intcmp=1281.

On this webpage you’ll see a list of things that you can download. What you want is either the 32-bit or the 64-bit version of the Java SE 7, JDK (or higher) – unless of course you’ve a compelling reason to be sticking to an older version. If you are running 32-bit Windows, then install the 32-bit version of Java – which is the file jdk-7-windows-i586.exe. Otherwise, if you’re running the 64-bit version of Windows, you can get the 64-bit version of Java (jdk-7-windows-x64.exe).

Simply click on the “Download” button. You’re now asked to select the platform and language. Check the “Accept License Agreement” radiobutton (there’s a link there to follow if you prefer to read it first), and then click on either the jdk-7-windows-i586.exe or the jdk-7-windows-x64.exe link (these may and likely will change, but hopefully it will still be obvious).

Double-click that file that you just downloaded to launch the installer. From here the installation process is pretty much self-explanatory. In the “Custom Setup” dialog, you’ll want to include “Development Tools” and “Public JRE” to be installed.

Now click on “Next >” to do the installation. It’ll take a moment.

You can view the Java SE documentation here. This has changed during the time since Oracle took over Java. Now I just link to the start page for all the documentation, rather than trying to locate and download an offline version.

Add your Java compiler’s executable folder to the PATH environmental variable. If you used the default path and the version you’re installing uses the same paths as it does as of 2011/8/20, then you’d add “;C:\Program Files\Java\jdk1.7.0\bin”. The initial semicolon is what separates this from the preceding text that is already in the PATH value (which can be very wordy!).

Add a CLASSPATH environment variable, setting it to “.;C:\Program Files\Java\jre7\lib” or else whatever applies on your system.

You can test that you’ve accomplished this successfully by opening a command-line window and typing: “javac -version”. It should respond with “javac 1.7.0” or some such, as you can see in Figure 2.

Figure 2

Figure 2

You now have Java installed and are ready to git down for some actual programming. I’ll add more how-to guides for getting started with command-line programs, Eclipse, Ant, and SWT/JFace.

And.. please do your part for world justice by considering what you can do to help with the great works of The good people at PETA.

James Hurst

Advertisements

About James W Hurst

a professional software designer since the beginning days of the desktop cptr and uC-controlled avionics, I today am focusing on Java, Swift, C# and F# for building mobile and desktop and online applications under Android, Xamarin.Forms, iOS, WPF, and ASP.NET-MVC along with the requisite HTML/CSS/JavaScript/Ajax for web applications. My database expertise has covered a panoply of different database-engines and modeling approaches, and my main area of academic interest is Artificial Intelligence and vision.
This entry was posted in Java, Software Design and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s