CodenameOne :“Path to javac not found” error

心不动则不痛 提交于 2021-01-29 10:38:51

问题


I start working with CodenameOne tool for multiplatform mobile dev. When I created "hello world" app and tried to build an .apk android file, I received

 [echo]       Error! Path to Javac not found! 
 [echo]       Make sure the JAVA_HOME enviroment variable is pointing to the JDK 
 [echo]       or define javac path in build.xml manually!

I added JRE reference to the project, but this didn't solve the issue. How can I solve it?


回答1:


Codename One needs to use the actual javac compiler and not ADT since some of our server code has some issues with ADT.

The JRE doesn't contain javac, you need to install a JDK (if you don't have one already) then make sure your OS defines the JAVA_HOME environment variable so it points at the root of the JDK dir (not the bin directory).

If this doesn't work (you might need to restart Eclipse to update environment within the process), then just double click the build.xml file and look for jdk. Update the path to the proper JDK path.




回答2:


Your best bet is to just setup the JAVA_HOME environment variable to point to your JDK directory



来源:https://stackoverflow.com/questions/17659201/codenameone-path-to-javac-not-found-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!