Reputation: 1147
I am trying to run Cordova on my ubuntu 12.04. When I try to create the project, its throwing me this error
k@k-cm:~/Development/Android/ionic/hello$ cordova platform add android
Checking Android requirements...
Creating android project...
[Error: An error occured during creation of android sub-project. Looks like your environment fully supports cordova-android development!
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.ionic.toderp
Name: toderp
Android target: android-17
Building cordova-3.2.0.jar
{ [Error: Command failed:
BUILD FAILED
/home/k/Dev/android-sdk-linux/tools/ant/build.xml:710: The following error occurred while executing this line:
/home/k/Dev/android-sdk-linux/tools/ant/build.xml:723: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-7-openjdk-i386/jre"
Total time: 0 seconds
] killed: false, code: 1, signal: null }
]
Here is my PATH
/usr/lib/jvm/java-7-openjdk-i386:/home/k/Dev/android-sdk-linux/tools:/home/k/Dev/android-sdk-linux/tools:/home/k/Downloads/android-ndk-r8e:/home/k/Downloads/android-ndk-r8e:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/k/Home/k/Dev/android-sdk-linux/tools:/home/k/Home/k/Dev/android-sdk-linux/platform-tools:/usr/lib/jvm/java-7-openjdk-i386/bin
JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386
Please help!
Upvotes: 1
Views: 2146
Reputation: 5799
This issue is due to that Ant can not find the tools.jar file.
You need to copy the tools.jar file and put it in the lib folder for the ant to work.
Do a search for tools.jar file in the lib folders from other sdk libraries and put that in the above path in error.
Upvotes: 1