我是phonegap的新手。当我尝试用cordova构建时,我遇到了这个问题:
sudo cordova build android
这是日志:
Running command: /home/paul/Documents/Projets/tozer0-app/platforms/android/cordova/build
[Error: Failed to find 'JAVA_HOME' environment variable. Try setting setting it manually.]
ERROR building one of the platforms: Error: /home/paul/Documents/Projets/tozer0-app/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/paul/Documents/Projets/tozer0-app/platforms/android/cordova/build: Command failed with exit code 2
有什么想法吗?
答案 0 :(得分:-1)
只需将JAVA_HOME,ANDROID_HOME和ANT_HOME添加到路径并指出相应的bin目录: 对于android studio
将此添加到〜/ .bashrc文件中:
你可以为Ant做同样的事情。 对于java jdk
将其添加到/ etc / profile文件中:
现在在终端中输入echo $ PATH并确保将所有环境变量添加到PATH中!