
當我嘗試從 gnome 終端安裝某些東西(使用 InstallAnywhere)時,我得到了類似的東西:
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
No Java virtual machine could be found from your PATH
environment variable. You must install a VM prior to
running this program.
解決方法是在開始安裝之前連接到localhost
viassh
或切換到控制台。ctrl+alt+f[x]
從命令列呼叫java
或whereis java
顯示正確的路徑。
答案1
您可以在腳本中設定和匯出 PATH 和其他環境變量~/.xprofile
,並使 java 對 X 會話可見。之後您應該重新登入 X 伺服器。
export PATH="$PATH:/path_to_jre/bin"
透過修改也可以得到相同的結果/etc/environment
。之後您應該會重新啟動。
PATH="...:/path_to_jre/bin"
使用 env 指令檢查您的 PATH 變數。
env | grep PATH