雖然在 Eclipse 中指定各專案使用哪個 JDK 來編譯,方法非常簡單,但這 JDK 的版本並非啟動 Eclipse jre 版本,兩者完全不相關。

那到底要怎麼指定 Eclipse 啟動的 JRE 版本??
參考Eclipse FAQ 得知:
1. 如果 JRE 裝在 eclipse/jre 這個目錄下, Eclipse 就會使用它來啟動。
2. Eclipse DOES NOT consult the JAVA_HOME environment variable
3. 直接使用 -vm 指令來指定
eclipse -vm c:\jre\bin\javaw.exe ''start Java by executing the specified java executable
eclipse -vm c:\jre\bin\client\jvm.dll ''start Java by loading the jvm in the eclipse process 

4. 在 eclipse.ini 設定 -vm

-vm
c:/jre/bin/client/jvm.dll 

NOTE: -vm 要擺在 -vmargs 上面,才不會啟動時報錯

至於要怎麼看 Eclipse 使用哪個 JVM 啟動??
Help > About Eclipse > Installation Details > Configuration 就可以看到詳細的資訊了

arrow
arrow
    文章標籤
    Eclipse JVM
    全站熱搜

    mark528 發表在 痞客邦 留言(0) 人氣()