当前位置:首页 >> 服务器

windows linux jdk安装配置方法

Windows
下个jdk包,安装,
JAVA_HOME=C:\java
PATH=C:\java\bin
CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
Linux
wget 192.168.1.101/jdk-6u11-linux-i586.bin
mv jdk-6u11-linux-i586.bin /usr/local/src/
cd /usr/local/src/
./jdk-6u11-linux-i586.bin
mkdir ../java
mv jdk1.6.0_11/* ../java/
vim /home/myz/.bashrc
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Test
// HelloWorld.java
import java.util.*;
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World");
System.out.println(new Date());
}
}
javac HelloWorld.java
java Helloworld