查看“Linux上安装jdk”的源代码
←
Linux上安装jdk
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=针对不同发行版本下载相对应包= <pre> evan@myxps:~/data/devops/jdk$ sha1sum jdk-8u212-linux-x64.rpm ca6872ac2f203637322ba2872cbfb3c5889d6c8d jdk-8u212-linux-x64.rpm evan@myxps:~/data/devops/jdk$ cat jdk-8u212-linux-x64.rpm.sha1 ca6872ac2f203637322ba2872cbfb3c5889d6c8d rpm -ivh jdk-8u121-linux-x64.rpm </pre> 官方可直接下载了 https://www.oracle.com/java/technologies/downloads/#java21 国内下载地址 https://repo.huaweicloud.com/java/jdk https://github.com/frekele/oracle-java/releases 最近Oracle发布了最新的Java SE 8u211 / Java SE 8u212,但是下载方式也改变了,原先点击Accept License Agreement同意协议即可下载,现在则多加了一步强制登录,看了下创建用户需要的信息还挺多,瞬间就没兴趣继续了;好在这个世界还是温暖的,已经有人将这些搬运到GitHub。详见:https://github.com/frekele/oracle-java/releases =下载通用二进制包解压安装 = <pre> #sep 2024 export JAVA_HOME=/home/evan/data/apps/jdk export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:$JAVA_HOME/lib:${JRE_HOME}/lib export PATH=$PATH:$JAVA_HOME/bin:$PATH #像debian 10上没有直接的 jdk8 deb包 那就这样吧 https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz tar xvf jdk-8u201-linux-x64.tar.gz mkdir -p /data/apps mv jdk1.8.0_201 /data/apps/jdk echo 'JAVA_HOME=/data/apps/jdk/ CLASSPATH=.:$JAVA_HOME/lib.tools.jar PATH=$PATH:$JAVA_HOME/bin export JAVA_HOME PATH' >>/etc/profile source /etc/profile # 如果是rpm包 #set java environment 建议用这个 JAVA_HOME=/usr/java/jdk1.7.0_79 JRE_HOME=/usr/java/jdk1.7.0_79/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH </pre> =configure= <pre> #set java environment 如果是rpm安装 JAVA_HOME=/usr/java/jdk1.8.0_121 JRE_HOME=/usr/java/jdk1.8.0_121/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH </pre> ==openjdk configure on kali == <pre> How to set JAVA_HOME in Linux for all users http://stackoverflow.com/questions/24641536/ddg#24641640 find /usr/lib/jvm/java-1.x.x-openjdk vim /etc/profile Prepend sudo if logged in as not-privileged user, ie. sudo vim Press 'i' to get in insert mode add: export JAVA_HOME="path that you found" export PATH=$JAVA_HOME/bin:$PATH logout and login again, reboot, or use source /etc/profile to apply changes immediately in your current shell evan@myxps:~$ java --version Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true openjdk 11.0.8 2020-07-14 OpenJDK Runtime Environment (build 11.0.8+10-post-Debian-1) OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Debian-1, mixed mode, sharing) evan@myxps:~$ ls /usr/lib/jvm/java-1. java-1.11.0-openjdk-amd64/ java-1.8.0-openjdk-amd64/ evan@myxps:~$ ls /usr/lib/jvm/java-1. java-1.11.0-openjdk-amd64/ java-1.8.0-openjdk-amd64/ evan@myxps:~$ ls /usr/lib/jvm/java-1.8.0-openjdk-amd64 </pre> =debian 移除java= <pre> jave version which java dpkg --list| grep -i java apt remove --purge <package-name> sudo rm -rf <install directory> </pre> https://blog.51cto.com/u_16175435/9074649 =参考= https://docs.oracle.com/en/java/javase/21/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A__INSTALLINGTHEJDKANDJREONLINUX-E04E90B9 [http://blog.51cto.com/vvxyz/1642258 LInux安装jdk的三种方法] [https://blog.csdn.net/zitong_ccnu/article/details/40041533 CentOS7卸载OpenJDK安装Oracle JDK] [https://www.jianshu.com/p/10949f44ce9c 在linux服务器上安装jdk] [http://blog.51cto.com/linux1990/1712758 Linux下安装JDK-(rpm版)] [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 官网下载] [http://wangxin0072000.iteye.com/blog/228977 使用rpm方式安装的jdk的目录位置] https://docs.oracle.com/cd/E19509-01/820-5483/inst_jdk_javahome_t/ http://wiki.jikexueyuan.com/project/linux-in-eye-of-java/JDK-Install.html https://my.oschina.net/u/2300159/blog/504775 [[category:ops]] [[category:linux]]
返回至
Linux上安装jdk
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
我的导航
关于我
shell
python
ops
linuxchina.net
blog.linuxchina
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息