使用Android sdk/build-tools/dx工具轉jar爲dex時出現:-Djava.ext.dirs is not supported

使用dx.bat工具出現以下錯誤:

-Djava.ext.dirs=C:\Users\EDZ\AppData\Local\Android\Sdk\build-tools\27.0.3\lib is not supported.  Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

解決方案:
參照https://www.jianshu.com/p/77db2ea8098f。
將dx.bat最後那句call “%java_exe%” %javaOpts% -Djava.ext.dirs="%frameworkdir%" -jar “%jarpath%” %params%中的-Djava.ext.dirs改爲–class-path即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章