About Paris Apostolopoulos
I have been receiving a lot of requests over the time, from students and people willing to experiment with the Java language, on providing a simple guide on how to setup a Java development environment , similar to the one I’ve written a year ago for Mac users. See here and here. So, this post is mainly addressed to people new to Java development, that seek information about setting up their Windows (7 or similar) environment, with all the basic tools and settings, in order to start writing Java code and experiment with various tools and technologies in the Java ecosystem.
I am pretty sure there are numerous similar resources out there, I just thought to add one more. Hope you find it handy. It is really easy, so don’t be afraid of the this post’s size, I just tried to elaborate on some simple steps, but for sure it is not rocket science
and you don’t have to be a ‘hacker’ in order to complete all the steps. You may not need all the tools below, so it is not necessary to have them all installed at once.
Index
5. Setup Git using Git Extentions (optional)
6. Setup a Java IDE, Netbeans or Eclipse ( this is a must)
1. Setup Java JDK and JAVA_HOME
Tip: One small tip or let’s say a deviation from the installer that I prefer, is to change the installation path provided by the program to something easier to remember or even type in the command line tool. So instead of installing the JDK to ‘C:\Program Files\Java\jdk7_17‘ etc, i always choose something that looks like the following, ‘C:\Java\jdk17‘.
We are almost there, we just need to set, one more environment variable, that is very important by many tools that are based on Java or require Java to work. It is the famous JAVA_HOME variable and you must have heard it or seen it in various tutorials and setup resources. It is easy though! Open your Advance System Settings ( Press Start , type in the search box ‘View Advanced System Settings‘, open it, select the tab ‘Advanced‘ and press the button in the bottom called ‘Environment Variables’). Add a new system variable as it is illustrated below. The name is JAVA_HOME and the path is actually the path our JDK installation, in my case ”C:\Java\jdk17‘.
Press OK, and open a new Command prompt ( it is required). Type ‘echo %JAVA_HOME%‘ and you are done.
2. Setup Apache Ant and ANT_HOME
Apache Ant is a popular build tool used in many Java projects and it is still needed in many cases when you need to setup some servers or complex projects. You can find more about Ant here. Installing Ant is easy, there is no fancy installer just a zip file you need to extract somewhere and add a similar varible like JAVA_HOME (see above) called ANT_HOME. At the time being, the latest version of Apache Ant is, 1.8.4. and can be downloaded here. After downloading the zip file, I choose to extract the contents to a similar path like before ‘C:\ant184‘. (make sure that c:\ant184 is the root folder and then you have all the sub-folders like c:\ant184\bin’. So, now we must set our ANT_HOME variable and add the ‘ant’ executable to our windows Path so that we can invoke it in our command line by typing ‘ant’. Setting ANT_HOME is similar to JAVA_HOME, add a new system variable named ANT_HOME and value the path where you have the ant zip extracted in my case ‘C:\ant184‘. See below
In order to add the ‘ant’ command to our executable path we need to update the PATH system variable, in the very same window, as illustrated below, just hit ‘Edit’. Go to the end of the line and add a new entry (all the entries are separated with ‘;’ ). The path for the ant executable is ‘C:\ant184\bin‘ but we will use the ANT_HOME variable in order to be more flexible so we will add, %ANT_HOME%\bin”. See the image below.
You are done, open a new Command Prompt, and type ‘ant -version‘, or ‘echo %ANT_HOME%‘ you should get similar results are illustrated in the image below.
Congrats, you have successfully installed Apache Ant! Some Java IDE’s have Apache Ant already pre-bundled (as we will see in a later section) but I truly believe it is better to be installed manually,it is cleaner and easier to maintain, update.
3. Setup Apache Maven and MAVEN_HOME
4. Setup Subversion (version control) using Tortoise SVN
You find the latest version of the client here, current is 1.7.11 (compatible with SVN 1.7.8). Download the executable and follow the steps. The only addition on the default settings is that I select to install the command line tools as well, as illustrated in the image below.
As I have already pointed out, most of the Java IDE’s around offer SVN integration, out of the box but is always a good thing to have an extra client, in your windows shell. Tortoise is a great one, you can actually work with tortoise and skip your IDE’s integration if you like so! If you don’t like Tortoise and you want to consider yet another client then I suggest you have a look on the free edition of SmartSVN.
5. Setup Git (version control) using Git Extentions
Git, is another version control system that is becoming very popular among developers in general. In many cases it is replacing SVN, so there is a high chance you might be required to work with it, or work in projects that store their code on a remote Git repository or contribute to an open source project at GitHub. You may find more about Git here.
Git is the new kid on the block on popular versioning systems, so some tools or support still may not be so user friendly comparing to tools and clients of SVN. Git is also encouraging users to interact with it, using the command line interface. The stand alone git installation for windows can be found here. This will install the git client and support tools and you may start experiments with it, using the command line. If you want a more UI friendly way, then you may choose one of the free clients. (so, don’t install the standalone client).
On the related prompt of the Git installer, about altering your System’s Path, I always select the second one, so that the ‘git’ command is added to my command line exec path. See the image below.
Continue with the rest of the installation and the various tools installed. The provided, default selections are safe to use.
As you can see, by the end you are going to have the related icons, copied in your Desktop. Congrats you have full Git support on your development environment! Double click on the Git Extentions icons and set the final details like language of use and username / email to be used while interacting with git repositories.
6. Pick your Java IDE : )
Netbeans
Continue with the rest of the installer prompts, your already existing JDK installation from step 1 should be picked accordingly by the setup script and be used by the IDE as well. The image below illustrates a fresh install of Netbeans running.
If you are looking for a quick guide or tutorial on using Netbeans, have a look here or have a look on numerous videos on youtube, here.
Eclipse
I don’t want the above paragraph to be the start of a flame war especially for hard cord eclipse users, I am actually an eclipse user myself, I just think that Netbeans is more ‘newbie’ user friendly, and it is critical that new java developers don’t get disappointed after trying to complete their first assignment or task in Java.
The latest version of Eclipse currently is Eclipse 4.2 SR2 (codename Juno), and the downloads page can be found here. You can either select the Eclipse for Java or JEE developers download, depending on your assignments/tasks or interest. Eclipse does not pre- install any servers or support tools as such. All the extra functionality should be added afterwards through the Plugin system that offers. (See Eclipse Market place). Eclipse does not have any installer, it comes as a zip file, all you have to do, is download the zip and extract the contents (like we did with Ant, or Maven). I usually pick a simple folder, like in previous section e.g ‘C:\eclipseJuno42′ . Open the folder and you will find the executable (eclipse.exe). You should have something like the image below.

If you don’t like Netbeans, neither Eclipse, you may try another popular option, Idea IntelliJ, it can be found here.
Reference: Setup your Java Development Environment in Windows 7 from our JCG partner Paris Apostolopoulos at the Papo’s log blog.
Source : http://www.javacodegeeks.com/2013/03/setup-your-java-development-environment-in-windows-7.html

















