windows linux jdk安装配置方法
(编辑:jimmy 日期: 2024/11/24 浏览:3 次 )
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
下个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
下一篇:apache tomcat 一个网站多域名的实现方法