Home > System Tutorial > LINUX > body text

Guide to installing Scala and Sun JDK on CentOS7.0

王林
Release: 2024-01-02 16:20:22
forward
959 people have browsed it

Today I installed Scala on centOS7.0 and found that the installed cenos7.0 has its own java-openjdk-headle.x86_64. I tried to see if it works but found that when I ran the .java source program, I found that the javac command could not be used. I had to uninstall the one that comes with the OS and install the jdk that comes with sun.

1. First check the openjdk package that comes with the OS

[root@mycentos01 bin]# rpm -qa | grep java java-1.7.0-openjdk-1.7.0.512.4.5.5.el7.x86_64
Copy after login

2. Uninstall related openjdk

[root@mycentos01 bin]#rpm -e --nodeps java-openjdk-headle.x86_64
Copy after login

3. Install jdk under your own sun official website

[root@mycentos01 bin]# tar -zxvf jdk-8u121-linux-x64.tar.gz
Copy after login

4. Install the Scala you downloaded

[root@mycentos01 bin]# tar -xzvf scala-2.10.6.tgz 
Copy after login

5. Configure your own environment variables

[root@mycentos01 bin]# vim /etc/profile 
Copy after login

CentOS7.0安装Scala和sun jdk的方法

6. Refresh the configuration file to make the configuration take effect

[root@mycentos01 bin]# source /etc/profile
Copy after login

Now enter java -version and scala -version to check the installation status. ^-^.

Today I also discovered a previous method of changing the host name of centOS7. I tried it but it didn’t work. I don’t know why I used the command to write HOSTNAME=" a name what I want my computer called." to the "/etc/sysconfig/network" file. It does not work after restarting, and make sure the input is the correct host name. Finally, use the hostnametcl tool to change it to a static host name. The command: "[root@mycentos01 bin]#hostnamectl set-hostname "your computer name you want to set ” ”

The above is the detailed content of Guide to installing Scala and Sun JDK on CentOS7.0. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template