Exception or error:
I would like to generate some .jar for tools to include in an Android project.
So I use command tool “javac” which works great.
But when I try to use Android SDK, it fails:
C:\Dev\Tools.java:123: package android.util does not exist android.util.Log.d("MYTAG", "hello !");
To compile, I use this command:
"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\javac.exe" -g -d C:\Gen C:\Dev\Tools.java
How to solve:
- “javac” is the Java compiler, not the tool used to create JAR files, so just compiling a class does not generate a jar file
- To be able to compile a class, you must also tell the compiler where it can find the required libraries. This is automatically done for system libraries, but you’ll have to pass the path to the Android libraries. This can be done by specifying the folders/jar files using the
-classpathparameter on the command line, or by adding it to the respective