返回顶部
首页 > 资讯 > 数据库 >ubuntu——How to Install Oracle Java JDK8
  • 413
分享到

ubuntu——How to Install Oracle Java JDK8

2024-04-02 19:04:59 413人浏览 泡泡鱼
摘要

Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a termina

  1. Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a terminal and run the following command below.    

    1. uname -a or file /sbin/init

 linux caochu-Inspiron-N5110 3.13.0-32-generic #57-ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Check if you have Java installed on your system. To do this, you will have to run the Java version command from terminal.
  1. Type/Copy/Paste:java -versio

    If you have Openjdk installed on your system, you have the wrong vendor version of Java installed for this exercise.

  2. sudo apt-get purge openjdk-*
Download the oracle Java JDK for Linux.
  1. Unpack the compressed Java binaries, in the directory /usr/local/java8

Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your./etc/profile file:
  1.  export JAVA_HOME=/usr/local/java8/jdk1.8.0_73 
     export JRE_HOME=${JAVA_HOME}/jre  
     export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
     export PATH=${JAVA_HOME}/bin:$PATH
  2.  source /etc/profile
 Configure default JDK version :
  1.   sudo update-alternatives --install /usr/bin/java  java  /usr/local/java8/jdk1.8.0_73/bin/java      300
     sudo update-alternatives --install /usr/bin/javac javac /usr/local/java8/jdk1.8.0_73/bin/javac    300
     sudo update-alternatives --install /usr/bin/jar   jar   /usr/local/java8/jdk1.8.0_73/bin/jar 300
     sudo update-alternatives --install /usr/bin/javah javah /usr/local/java8/jdk1.8.0_73/bin/javah  300
      sudo update-alternatives --install /usr/bin/javap javap /usr/local/java8/jdk1.8.0_73/bin/javap 300

  2. sudo update-alternatives --config java 

Test
  1. java -version




















您可能感兴趣的文档:

--结束END--

本文标题: ubuntu——How to Install Oracle Java JDK8

本文链接: https://lsjlt.com/news/38593.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作