Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

replacement for bootclasspath option in java

I am trying to build an Android app manually just from the command line without using any kind of extra things, such as the build system (Gradle). I am following this page.

But, I am stuck at compiling the Java source files.
Whenever I am issuing the command :
javac -d obj -classpath src -bootclasspath E:/.android/sdk/platforms/android-10/android.jar src/com/example/hello/MainActivity.java
(My Android SDK is in E:/.android/SDK folder)
I am getting
error: option --boot-class-path not allowed with target 12
I am using JDK version 12.0.2. I came to know that the boot-class-path option was removed since JDK version 9. So, how to compile the Java source files? What is the alternative to the boot-class-path option in JDK 12.0.2?

like image 870
Puspam Avatar asked Oct 16 '25 04:10

Puspam


1 Answers

Java 9 and beyond don't support the bootclasspath option, but the bootclasspath can also be treated as a normal classpath. I had included the bootclasspath path with classpath and it worked.

javac -d obj -classpath src -bootclasspath E:/.android/sdk/platforms/android-10/android.jar src/com/example/hello/MainActivity.java

I just removed the -bootclasspath and included the path to android.jar into classpath.

javac -d obj -classpath src;E:/.android/sdk/platforms/android-10/android.jar src/com/example/hello/MainActivity.java

like image 89
Puspam Avatar answered Oct 18 '25 19:10

Puspam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!