79463627

Date: 2025-02-24 13:10:35
Score: 0.5
Natty:
Report link

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:

  1. what is classpath?
  2. Build APK from CLI
Reasons:
  • RegEx Blacklisted phrase (1.5): I am new
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
Posted by: Faraaz Kurawle