1. 程式人生 > >_____[BUG]記錄一個jdk安裝錯誤 error: open of failed:No such file or directory

_____[BUG]記錄一個jdk安裝錯誤 error: open of failed:No such file or directory

今天在一臺新機器, 採用rpm方式安裝jdk, rpm -ivh jdk-8u181-linux-i586.rpm 

安裝過程發生了錯誤, 錯誤資訊包含大量的html相關資訊:

error: open of <html> failed: No such file or directory
error: open of <head> failed: No such file or directory
error: open of <title>Unauthorized failed: No such file or directory
error: open of Request</title> failed: No such file or directory
......

查究之後發現是因為wget下載rpm的地址不對, 導致下載的rpm檔案其實是一個html,只不過被命名成了.rpm

進入官網 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

下面copy下載地址的方式是不對的:

上面copy到的地址是:

http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-i586.rpm

而正確獲取下載地址的方式是, 在官網rpm檔案上直接點選下載

, 然後去瀏覽器的下載面板上copy真正的地址, 比如

這樣copy到的地址是:

http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-i586.rpm?AuthParam=1538834264_51c09eb89d00e651a969b47776fbdb72

//對比發現正確的連結多了認證引數AuthParam