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
2. Uninstall related openjdk
[root@mycentos01 bin]#rpm -e --nodeps java-openjdk-headle.x86_64
3. Install jdk under your own sun official website
[root@mycentos01 bin]# tar -zxvf jdk-8u121-linux-x64.tar.gz
4. Install the Scala you downloaded
[root@mycentos01 bin]# tar -xzvf scala-2.10.6.tgz
5. Configure your own environment variables
[root@mycentos01 bin]# vim /etc/profile
6. Refresh the configuration file to make the configuration take effect
[root@mycentos01 bin]# source /etc/profile
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!