Install and configure j2sdk:
Run the j2sdk installer and install it according to the default settings. You can also customize the path, but you need to modify the following configuration.
Configure j2sdk:
Configure environment variables:
Choose my computer> Properties> advanced> environment variables> system variables to add the following environment variables:
Java_home = C:/program files/Java/jdk1.5.0 _ 04
Classpath = % java_home %/lib/dt. jar;
% Java_home %/lib/tools. jar;
Path = % java_home %/bin;
Write a simple Java program to test whether j2sdk has been installed successfully:
Public class hello
{
Public static void main (string ARGs [])
{
System. Out. println ("hello ");
}
}
Save the program as a file named hello. java.
Open the Command Prompt window, go to the directory where hello. Java is located, and type the following command:
Javac hello. Java
Java hello
How do I configure system variables for JDK and tomcat environment variables?
Java_home: C:/program files/Java/jdk1.6.0
Path: C:/program files/Java/jdk1.6.0/bin
Classpath:.; C:/program files/Java/jdk1.6.0/lib/dt. jar; C:/program files/Java/jdk1.6.0/lib/tools. jar;
Tomcat_home: C:/program files/Apache Software Foundation/tomcat 6.0
Catalinda_home: C:/program files/Apache Software Foundation/tomcat 6.0
You can create these variables in your user environment variables. As long as you enter the user who sets the environment variable when starting the instance.
It can also be written in system environment variables. It is valid for all users. However, because path is an existing system environment variable, You need to edit it (instead of creating a new one). First, write a semicolon to separate it, and then put C: /program files/Java/jdk1.6.0/bin fill in the path. You can create other environment variables.
References:
Http://hi.baidu.com/qinxiaoli0309/blog/item/bebc3fd8a689f8ef38012f75.html
Http://topic.csdn.net/t/20030613/15/1912134.html
Http://www123me.blog.163.com/blog/static/127953327201022133829962 .... Good
Bytes .... Good Graphic references