Addition to @jcomeau_ictx 's answer,
classes: $(SOURCES)
javac -d obj \
-cp $(ANDROID) \
src/com/example/hello_world/*.java
would result in clean output.
I am not well versed in java, but after reading java docs, I am able to interpret that -bootclasspath
option is depreceated in JDK 9+
--boot-class-path path or -bootclasspath path Overrides the location of the bootstrap class files. Note: This can only be used when compiling for releases prior to JDK 9. As applicable, see the descriptions in --release, -source, or -target for details. For JDK 9 or later, see --system.
Why -classpath
works?
--class-path path, -classpath path, or -cp path Specifies where to find user class files and annotation processors. This class path overrides the user class path in the CLASSPATH environment variable.
Since we need to use android.jar
, we can add it to classpath and let JVM know that android package exists.
Note: My explanation may not be correct or well explanatory since I am new to java and android
References: