jdk and eclipse, ultra-detailed tutorial installation under Ubuntu / linux

1, first download jdk and the Eclipse
jdk official download site: http: //www.oracle.com/technetwork/java/javase/downloads/index.html

Official sometimes under very slowly, Baidu network disk ready jdk8: https: //pan.baidu.com/s/1gXg47NEL99EhHvBT8eMZjA

eclipse official Download: http: //www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr1/

Baidu network disk ready-made eclipse-jee-luna-SR2: https: //pan.baidu.com/s/1HibWF7FAbP3vCNXu5BPR5g

If you do not understand the meaning of the downloaded file name, see my other article: https: //blog.csdn.net/yinghuo110/article/details/80658308

Basically, the present computers are 64-bit, so choose x_64 download. Unzip tar.gz format Ubuntu system is that if you are a Red Hat linux, then select .rpm

2, install JDK
2.1, unzip the JDK
1, the JDK extract to / opt / jvm folder, so you have to first create a new jvm folder under / opt, and to the need to obtain root privileges opt folder create a new folder, so it is necessary sudo command. Instructions in / opt new folder, jvm: sudo mkdir / opt / jvm 

 

 

 

After you enter the command to enter a password before they can perform, there will be no password is displayed. After you enter press enter it.

2, after the completed folder, to download a good jdk installation package is moved from the original position to this folder jvm

Instruction is used: sudo mv /home/jdk-8u172-linux-x64.tar.gz / opt / jvm

 

 

 

3, to extract the jdk jvm folder, the first change directory to jvm: cd / opt / jvm; jdk to unzip the jvm directory: sudo tar zxvf jdk-8u172-linux-x64.tar.gz / opt / jvm

Detailed tar command: https: //www.cnblogs.com/xiaochina/p/5801959.html

 

 

 

4, the configuration environment variable JDK

(1) the main directory to directory: cd + carriage (2) open / etc / profile: sudo vi / etc / profile, you will enter the vim editor. vi operation instruction Encyclopedia: http: //man.linuxde.net/vi

(3) add the following statement at the end of file configuration, the interval between each statement in line   


            export JAVA_HOME=/opt/jvm/jdk1.8.0_172

            export JRE_HOME=${JAVA_HOME}/jre

            export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

            export PATH=${JAVA_HOME}/:$PATH 

 

 

 

(4) Input source / etc / profile so that just the configuration take effect immediately

(5) to see if the installation was successful jdk

Enter java -version. If successful installation is displayed jdk version

 

 

 

3, mounting the Eclipse
3.1, to extract the specified directory eclipse / opt

       1. First eclipse compressed packet is moved to the specified directory / opt

        Command is: sudo mv /home/eclipse-jee-luna-SR2-linux-gtk-x86_64.tar.gz / opt

                  

 

 

       2. Extract compressed eclipse: first switch to the directory / opt, then extract to / opt under

         指令:1.  cd /opt  2. sudo tar zxvf  eclipse-jee-luna-SR2-linux-gtk-x86_64.tar.gz    不指定目录的话,默认将当前路径的文件解压到当前路径

            

 

 

          解压完,可以用 ls 命令查看一下文件夹里面有没有多出文件

                  可见多出了一个解压后的eclipse文件夹。

3.2 此时虽然可以启动eclipse了,但是每次都要进入安装目录里面。所以接下来为eclipse创建桌面图标

 

    第一种:

        进入 /usr/share/applications,找到所需的软件的快捷方式,拷贝到桌面就可以了。

        这种方法不适用所有程序,有的程序不会在这里创建快捷方式。

     第二种:自己在applications文件夹中建一个快捷方式,然后再拷贝到桌面

           cd /usr/share/applications

           sudo vim eclipse.desktop  

            

           进入编辑模式之后,把下面的代码复制上去

            [Desktop Entry]
            Encoding=UTF-8
            Name=eclipse
            Comment=Eclipse IDE
            Exec=/opt/eclipse/eclipse        
            Icon=/opt/eclipse/icon.xpm
            Terminal=false
            starttupNotify=true
            Type=Application

            Categories=Application;Development;

 

            然后保存并退出,在命令模式下输入  :wq +回车

            其中    Exec对应的是eclipse启动文件,Icon对应的是eclipse图标。上面这段代码里,有的不是必须的,还有就是这里没有列出所有的配置(个人水平有限 ^_^ )。里面的Icon指的是程序图标的绝对路径,Exec配置的是所要运行程序的绝对路径。如果想要了解更多的配置,可以查看别的更专业的资料,这里给个参考链接。

            最后再将 eclipse.desktop拷贝到桌面,以后就能直接在桌面启动了。

 

 

 

 

 

 

第三种:

还是以eclipse为例,具体根据自己的进行修改

运用软链接的方法

在命令窗口中输入:

ln -s /opt/eclipse/eclipse ~/Desktop

即可在桌面看到相应的快捷方式。这里前一个路径是程序的源路径,第二个是需要创建快捷方式的地方。   此方法还未亲自验证

因为Ubuntu是可以桌面操作,所以 /home 下移动文件和解压文件都可以用鼠标操作,但是在 filesystem 中对文件的操作都需要权限,所以还是需要在字符界面操作。

至此一整套在Ubuntu下安装jdk和eclipse的方法就完成了。
————————————————
版权声明:本文为CSDN博主「是世博呀」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yinghuo110/article/details/80726750

Guess you like

Origin www.cnblogs.com/zywnnblog/p/12199665.html