首页 > 代码库 > linux安装JDK

linux安装JDK

 

jdk的下载:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
?  src rpm -ivh jdk-8u101-linux-x64.rpm 

 

?  /usr lsbin  games    java  lib64    local  share  tmpetc  include  lib   libexec  sbin   src?  /usr pwd/usr
?  java rpm -qa|grep jdk jdk1.8.0_101-1.8.0_101-fcs.x86_64?  java lsdefault  jdk1.8.0_101  latest
?  java java -version java version "1.8.0_101"Java(TM) SE Runtime Environment (build 1.8.0_101-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

写个小编序,来测试:

?  ~ cat Hello.java public class Hello {    public static void main(String[] args)    {        System.out.println("Hello");        }}

编译:

?  ~ javac Hello.java 

执行:

?  ~ java HelloHello

测试成功!!!

卸载JDK:(并没有测试)

?  ~ rpm -qa|grep jdkjdk1.8.0_101-1.8.0_101-fcs.x86_64?  ~ rpm -e --nodeps jdk1.8.0_101-1.8.0_101-fcs.x86_64

 

linux安装JDK