zoukankan      html  css  js  c++  java
  • Ubuntu下安装jdk1.8和eclipse

    配置jdk参考https://www.linuxidc.com/Linux/2017-02/140908.htm

    需要配置/etc/environment,配置完如下所示

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$JAVA_HOME/bin"
    export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    export JAVA_HOME=/opt/jvm/jdk1.8.0_191

    再通过source /etc/environment生效

    还要配置/etc/profile,配置完如下所示

    # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
    # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
    
    if [ "$PS1" ]; then
      if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
        # The file bash.bashrc already sets the default PS1.
        # PS1='h:w$ '
        if [ -f /etc/bash.bashrc ]; then
          . /etc/bash.bashrc
        fi
      else
        if [ "`id -u`" -eq 0 ]; then
          PS1='# '
        else
          PS1='$ '
        fi
      fi
    fi
    
    if [ -d /etc/profile.d ]; then
      for i in /etc/profile.d/*.sh; do
        if [ -r $i ]; then
          . $i
        fi
      done
      unset i
    fi
    
    #set Java environment
    
    export JAVA_HOME=/opt/jvm/jdk1.8.0_191
    export JRE_HOME=$JAVA_HOME/jre
    export CLASSPATH=.:$JAVA_HOME/lib:$JAR_HOME/lib:$CLASSPATH
    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

    同样通过source /etc/profile生效

    安装eclipse参考https://blog.csdn.net/qq_37549757/article/details/56012895

    首先通过解压命令

    sudo tar zxvf eclipse-inst-linux64.tar.gz -C /opt/ 

    解压到/opt目录下,然后

    cd /usr/share/applications

    再然后

    sudo vim eclipse.desktop 

    输入如下内容

    [Desktop Entry]
    Encoding=UTF-8
    Name=Eclipse
    Comment=Eclipse
    Exec=/opt/eclipse-installer/eclipse-inst
    Icon=/opt/eclipse-installer/icon.xpm
    Terminal=false
    StartupNotify=true
    Type=Application
    Catagories=Application;Development;

    再输入命令

    sudo chmod u+x eclipse.desktop

    然后将图标从/usr/share/applications粘贴到桌面打开安装即可。

  • 相关阅读:
    .NET破解之百分百营销软件系列
    未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序
    .NET破解之百度网盘批量转存工具
    The system clock has been set back more than 24 hours
    64位系统中读写注册表
    FME2014汉化问题
    FME中Cass扩展属性转Shp的方法
    Hosts文件小结
    浅谈Java中的equals和==
    mysql读写分离
  • 原文地址:https://www.cnblogs.com/csdeblog/p/10050102.html
Copyright © 2011-2022 走看看