2013年10月30日 星期三

解決在 eclipse 編譯過程中無法正常編譯 且 ToolProvider.getSystemJavaCompiler() returns null 的問題


一般來說是因為在eclipse 中使用錯誤的 jre standard VM開發環境
設定正確即可



 詳細步驟:

  1. Go to Java->Installed JREs. Add your JDK as a runtime. You may choose to select this JDK to use for all your FUTURE projects. However your selection will not take effect on existing projects. Hence onto step 2.
  2. Select your project's properties. Select Java Build Path.
  3. Under the Libraries tab, select JRE System Library [jreblahblahblah] and Edit it.
  4. Select Alternate JRE and use the dropdown to find the JDK that you just added.
  5. Clean your project and rebuild.

 

參考:
null JavaCompiler in Eclipse
ToolProvider.getSystemJavaCompiler() returns null - usable with only JRE installed?

沒有留言 :

張貼留言