因爲重裝了系統,把以前的Eclipse文件夾拷貝到新系統時,發現只能從終端用命令啓動,若是點擊界面中的圖標,則會遇到以下錯誤:java
一、Java RunTime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No java virtual machine was found after searching the following locations:… 。一直提示沒有找到JDK,儘管我已經安裝了,且設置了環境變量。linux
<!-- lang: shell --> A、方法一android
dell@dell-OptiPlex-7010:~$ cd android/eclipse/ //進入eclipse目錄 dell@dell-OptiPlex-7010:~/android/eclipse$ mkdir jre dell@dell-OptiPlex-7010:~/android/eclipse$ cd jre/ dell@dell-OptiPlex-7010:~/android/eclipse/jre$ ln -s /usr/java/jdk1.6.0_43/bin /bin B、方法二 dell@dell-OptiPlex-7010:~$ sudo ln -s /usr/java/jdk1.6.0_43/bin/java /usr/bin/java
二、若是使用方法一時,在Eclipse中啓動Android SDK Manager時,遇到錯誤:./android-sdk-linux/tools/android: 84: java: not foundshell
<!-- lang: shell --> dell@dell-OptiPlex-7010:~$ sudo ln -s /usr/java/jdk1.6.0_43/bin/java /usr/bin/java
linux中命令 ln 是用來創建軟連接。eclipse