forked from totemtec/documents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Java Installation.txt
44 lines (30 loc) · 1.32 KB
/
Java Installation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
在CentOS 6.3 x64 测试
1.下载对应版本的JDK到Linux机器上:
#
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O /opt/jdk-7u55-linux-x64.rpm
如果网速太慢,超过30分钟会被服务器断掉
可以自己先下载了,然后使用scp再传上服务器
远程加密传输文件
scp local_file user_name@remote_server:path
scp ~/tomcat.tar.gz root@192.168.0.2:~/upload/
2.赋权限:
# chmod +x /opt/jdk-7u55-linux-x64.rpm
3.安装:
# rpm -Uvh /opt/jdk-7u55-linux-x64.rpm
4.设置java环境:
# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_55/jre/bin/java 20000
# alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_55/bin/jar 20000
# alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_55/bin/javac 20000
# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_55/jre/bin/javaws 20000
# alternatives --set java /usr/java/jdk1.7.0_55/jre/bin/java
# alternatives --set javaws /usr/java/jdk1.7.0_55/jre/bin/javaws
# alternatives --set javac /usr/java/jdk1.7.0_55/bin/javac
# alternatives --set jar /usr/java/jdk1.7.0_55/bin/jar
检查一下配置:
# ls -lA /etc/alternatives/{jar,java*}
5.是否成功安装JDK验证:
# java -version