Just a quickie post that may be of interest to some people.
I have found that if I compile from the B4J IDE using java 10, I have not found a decompiler (so far) that is able to reproduce the source from the jar, if I add any inline code (even code that does not get executed).
Example, adding the following code upsets the decompiler (it lists the class contents as null).
But the resultant jar runs fine.
Please note. The IDE cannot use the above code as is, as it relies on java source level 10, and will generate an error about source > 1.8. you need to intercept the compile and change the source & target to 10.
I have found that if I compile from the B4J IDE using java 10, I have not found a decompiler (so far) that is able to reproduce the source from the jar, if I add any inline code (even code that does not get executed).
Example, adding the following code upsets the decompiler (it lists the class contents as null).
B4X:
public static void dontDecompileMe(){
var temp = "hello"; // java 10 allows var (it's like Object but knows what it is).
}
But the resultant jar runs fine.
Please note. The IDE cannot use the above code as is, as it relies on java source level 10, and will generate an error about source > 1.8. you need to intercept the compile and change the source & target to 10.