Android Question How to do the same as B4J's #CommandLineArgs

OliverA

Expert
Licensed User
Longtime User
Is there a facility in B4A that is similar in functionality to B4J's #CommandLineArgs? I've ran into an issue (see https://www.b4x.com/android/forum/threads/use-foreign-java-code.158943/post-975812) where the compiler produces the following (abbreviated) error message:

Compiling generated Java code. Error
An exception has occurred in the compiler (18.0.1). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Symbol.flags()" because "base" is null

According to a post I found here (https://stackoverflow.com/a/69179997), if I could pass
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
to the compiler, I might be able to proceed with the above project. But for now, I'm just stuck.

Note:
I've tried JDK 8, 11, 14, and 18 with the same/similar results, just in case anyone wants to know.
 

OliverA

Expert
Licensed User
Longtime User
Are you sure that you are using Java features that are supported by Android?
I'm guessing yes. The Ethernet support seems to require some special android.jar file, the jvmargs resolution is on an Android section of Stackoverflow.com, and people seem to be able to do such things in Android Studio. I do agree this seems to be an extreme edge case of Android development.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
No such thing. And there are no modules in Android.
Looks like java vm args for an application can somehow be set with a Gradle plugin in Android Studio. Outside of that, I don't think there is a readily available solution. :-(
 
Upvote 0
Top