Setup your Java Working Space

Welcome again,

This morning, my exciting class had came and I had a lot of work. The biggest thing that I should take a note is how to setup my working space with Java.

When I started to work with Java – setup my first environments. I got many concepts that cannot seperated. It made me so confused. After this morning class, I stay at school to setup my working space. And, you know, I had to installed and re-installed 3 times to get well-done my space. Gruuu!!! Let it be. Here is my work:

Objectives: Installing the java working environment in Windows Vista Home Basic. Here is components wished to installed:

- JDK6 (Java SE Development Kit 6) – download at 25th, Feb 2008: this is a toolkit for development – as its name ^^

- JRE6 (Java Runtime Environment 6) – download at 25th, Feb 2008: this is needed enviroment for running java (java classes, java applications, …)

- Apache Tomcat 6.0.16: this is a servlet container that uses for Java Servlet and Java Server Pages technologies.

- Apache Ant 1.7.0: this is a Java-based build tool. In theory, it is kind of like Make, without Make’s wrinkles and with the full portability of pure Java code. (source: http://ant.apache.org/faq.html#what-is-ant )

- Java Doc: java documentations – how working with Java language.

- junit 4.4: this is a testing framework when working with Java language.

- Java Tools: install some helpful tools when working with Java.


Step by steps:

1. Pre-Installation:
Before starting install your Java Working Space, you should make sure about some points:

- Remove all the older version of Java (I’m not sure about the conflict between versions cause this version of Java – v6 – has some new features).

- Follow this recommend about the installation’s structure: this will make your space becomes more clearly:

+ Create the folder named: “appl” right inside the C: folder. All the installation will put here.

+ Create these child folder of “appl” folder:

~ “jdk” folder >> C:appljdk

~ “jre” folder >> C:appljre

~ “Tomcat” folder >> C:applTomcat

~ “Ant” folder >> C:applAnt

~ “junit” folder >> C:appljunit

~ “tools” folder >> C:appltools

2. Intall JDK 6 and JRE 6:
This is the step that I stucked because of the changing way of install from this JDK version. You download the “jdk-6u4-windows-i586-p run.exe” and double clicks to start the installation.
Go through the steps to install JDK. REMEMBER changing the PATH points to “C:appljdk” at the first step. See those figures below:

- Lisence Agrrement: Choose “Accept

s6.jpg

- Custom Setup: change the Path in this step. Then click “Next”.


s5.jpg

- Installing: wait wait wait. ^^


s2-3.jpg

- After few minutes, the installtion will stop at the moment to takes toyou to the JRE setup step. Remember to change the Path to: “C:appljre”. Then click “Next”.


s2-4.jpg

- Installing… wait again ^^.


s2-5.jpg

- Once more… until the installtion finish ^^

s2-6.jpg

3. Install Apache Tomcat:
Go to apache’s website, download the “apache-tomcat-6.0.16.zip”.
Copy the .zip file to the “C:applTomcat” folder, extracting it (Extract here…)

s3-1.jpg

s3-2.jpg

After extracting, you’ll get the folder like this: “C:applTomcatapache-tomcat-6.0.16”:

s3-3.jpg

4. Install Apache Ant:
- Go to apache-ant’s website, download the “apache-ant-1.7.0-bin.zip”. Copy the .zip file to the “C:applAnt” folder, extracting it (Extract here…):

s4-2.jpg

After extracting, you’ll get the folder like this: “C:applAntapache-ant-1.7.0
s4-3.jpg

s4-1.jpg

5. Install Java Documentations:
Go to Sun’s website and download the latest documentation. I use the “jdk-6-doc.zip” file. Copy the .zip file to the “C:appljdk” folder, extracting it (Extract here…). After extracting, you’ll get the folder like this: “C:appljdkdocs”:

s5.jpg

6. Install junit 4.4:
Go to http://www.junit.org to download the latest version of junit. I use the “junit4.4.zip”. Copy the .zip file to the “C:appljunit” folder, extracting it (Extract here…). After extracting, you’ll get the folder like this: “C:appljunitjunit4.4”:

s6.jpg

7. Install Java Tools:
In this case, I recommend you to install one of these tools: JCreator and NetBeans IDE.

+ The newest version of Jcreator is 4.5.0. Just follow through steps of installation. Remember change the install path to: “C:appltools”:


s7-1.jpg

NetBeans IDE: I use the version 6.0.1.

8. Configuration Work Space:
You’ve finished the installation your own Java Work Space. Now, spend a few minutes to make sure that all these work. You need to have permission to entry the Environment Variables:

- Right click to: My Computer >> Propoperties

- Choose Advance System Setting. At the tab “Advance”, choose “Environment Variables”.

+ In the space “System Variables”: create 2 new variables like this:

+ Add this value to the end of Path variable: ;C:appljdkbin. Remember the “;” before. It uses to seperate this variable to all variables ahead. The rest points to bin folder of installed JDK. This step will help you when compling any .java file from everywhere.

+ Variable Name: JAVA_HOME that has the Value C:appljdk

+ Variable name: ANT_HOME that has the value C:applTomcatC:applAntapache-ant-1.7.0
(Note that the value of 2 variables point to the “home” folder that install Java and Tomcat: jdk and Ant folder)

+ Check your configuration:

~ Run the “cmd”. Type “javac”. If the configuration is correct, all the Useage for this command will be listed.

~ Run the “cmd” again. Move to the Tomcar installation folder. ( in this case, the path is: C:applTomcatapache-tomcat-6.0.16/bin >> use “dir” command to list all the file inside bin folder. Type: “startup.bat”. If your configuration is correct, another command promt from Tomcat will display. This’s also the command to start Tomcat. ^^

~ Open the broswer, type “http://localhost:8080 in the address bar. The successfully page will display (with a cute cat ^^)

Advertisement

~ by vanganhxinh on February 25, 2008.

One Response to “Setup your Java Working Space”

  1. [...] 2. Java installation: see previous article at http://vanganhxinh.wordpress.com/2008/02/25/setup-your-java-working-space/ [...]

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 )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.