I have installed the 64 bit version 9.40 of B4J. Because I also want to create the JavaDoc with SLC version 1.11, I use javac 1.8.0_361. That doesn't cause any problems, except for the code below:
The above Java routine with SLC gives the following error:
What am I doing wrong and how do I fix this error message?
Declare and initialize a B4J variable in Java:
package b4x.example;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
@Version(1.0f)
//@Permissions(values={"android.permission.INTERNET"})
@ShortName("B4JTest")
//@DependsOn(values={"some java library "})
//@ActivityObject
public class B4JTest {
/**
* How to declare and initialize a B4J variable in Java
*/
public static void changeB4JVariable(String[] args) {
// Get a reference to the current B4J instance
BA ba = new BA(null, null);
// Read a B4J variable
int _myvariable = (int) ba.sharedProcessBA.getBBObject().getField("_myvariable");
// Write a B4J variable
ba.sharedProcessBA.getBBObject().setField("_myvariable", _myvariable + 1);
}
}
The above Java routine with SLC gives the following error:
SLC error:
Starting step: Compiling Java code.
javac 1.8.0_361
D:\Data\1 B4X SLC\SimpleLibraryCompiler\SimpleLibraryCompiler\A B4JTest\src\b4x\example\B4JTest.java:18: error: BA is abstract; cannot be instantiated
BA ba = new BA(null, null);
^
1 error
Error.
What am I doing wrong and how do I fix this error message?