Daestrum Expert Licensed User Longtime User May 24, 2018 #1 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). Code: 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.
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). Code: 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.
Daestrum Expert Licensed User Longtime User May 24, 2018 #2 Dammit - found one lol. Oh well it was good while it lasted. As regard to first post (now I can see what it did) The compiler actually compiled Code: public static void whatever(){ var v = "hello"; } to Code: public static void whatever(){ String v = "hello"; } I am gonna get sooooo lazy now lol. Last edited: May 24, 2018
Dammit - found one lol. Oh well it was good while it lasted. As regard to first post (now I can see what it did) The compiler actually compiled Code: public static void whatever(){ var v = "hello"; } to Code: public static void whatever(){ String v = "hello"; } I am gonna get sooooo lazy now lol.