linux install jdk1.8 error bash: export JAVA_HOME = / usr / local / java / jdk1.8.0_144: No such file or directory

Yesterday the company a single physical machine configuration environment, install jdk1.8 download from the official website of oracle 1.8 tar pack and unpack, and configure the environment variables
but execution source / etc / profile encounter problems following screenshot:

bash: export JAVA_HOME=/usr/local/java/jdk1.8.0_144: 没有那个文件或目录
-bash: export JAVA_BIN=/usr/local/java/jdk1.8.0_144/bin: 没有那个文件或目录
-bash: export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin: 没有那个文件或目录
-bash: export CLASSPATH=.:/lib/dt.jar:/lib/tools.jar: 没有那个文件或目录
bash: export JAVA_HOME JAVA_BIN PATH CLASSPATH: 未找到命令...

See this issue, I think the unpacked directory

[root@localhost jdk1.8.0_144]# pwd                                                          
/usr/local/java/jdk1.8.0_144                                                                   
[root@localhost jdk1.8.0_144]# ll                                                              
总用量 25848                                                                                   
drwxr-xr-x. 2 10 143     4096 7月  22 13:08 bin                                                
-r--r--r--. 1 10 143     3244 7月  22 13:07 COPYRIGHT                                          
drwxr-xr-x. 4 10 143     4096 7月  22 13:07 db                                                 
drwxr-xr-x. 3 10 143     4096 7月  22 13:07 include                                            
-rwxr-xr-x. 1 10 143  5097973 6月  27 04:26 javafx-src.zip                                     
drwxr-xr-x. 5 10 143     4096 7月  22 13:07 jre                                                
drwxr-xr-x. 5 10 143     4096 7月  22 13:08 lib                                                
-r--r--r--. 1 10 143       40 7月  22 13:07 LICENSE                                            
drwxr-xr-x. 4 10 143     4096 7月  22 13:07 man                                                
-r--r--r--. 1 10 143      159 7月  22 13:07 README.html                                        
-rw-r--r--. 1 10 143      526 7月  22 13:07 release                                            
-rw-r--r--. 1 10 143 21111510 7月  22 13:07 src.zip                                            
-rwxr-xr-x. 1 10 143    63933 6月  27 04:26 THIRDPARTYLICENSEREADME-JAVAFX.txt                 
-r--r--r--. 1 10 143   145180 7月  22 13:07 THIRDPARTYLICENSEREADME.txt                        
[root@localhost jdk1.8.0_144]#  

Confirmation, and then let the operation and maintenance colleagues to help look at the issue is not resolved, with a puzzled, at home, in their own virtual machine configuration, but no problems were encountered.
This morning, the company still came to the investigation, from the Baidu search, said jdk version median follow-digit system can lead to inconsistency, but I do not have a problem.

The trouble should end it, my software over the wall by FreeVPN Plus, google it and see the results

Open the first article, found that even with my environment variable configuration is not the same

# gedit /etc/profile
在最后添加下面代码:

export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH

The figure is a google search out, and then try to change it, do source / etc / profile

My original configuration:
Write pictures described here

[root@localhost jdk1.8.0_144]# java -version                                                   
java version "1.8.0_144"                                                                       
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)                                          
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)                               
[root@localhost jdk1.8.0_144]# 

Sure enough success.

Published 46 original articles · won praise 27 · views 160 000 +

Guess you like

Origin blog.csdn.net/shichen2010/article/details/77964188