Java Question Using SLC v1.11 on a published library ~ warnings?

mjcoon

Well-Known Member
Licensed User
I have just started using this apparently simple tool to extend a "CompassView" library (from 2015) downloaded from here: https://www.b4x.com/android/forum/attachments/javacode-zip.36178/

(N.B. This is the style of compass I want, not one of the numerous other ones available.)

In fact I am making progress and successfully made a change which gives me the motivation to persevere. However I get strange warning messages even with the unaltered version as downloaded from the above link, as follows:
Starting step: Compiling Java code.
javac 11.0.1

Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Loading source file C:\Users\Mike\AppData\Local\Android\B4A\b4aCompassView\CompassView-master\src\compassviewwrapper\compassViewWrapper.java...
Loading source file C:\Users\Mike\AppData\Local\Android\B4A\b4aCompassView\CompassView-master\src\main\com\redinput\compassview\CompassView.java...
Loading source file C:\Users\Mike\AppData\Local\Android\B4A\b4aCompassView\CompassView-master\src\main\com\redinput\compassview\R.java...
Constructing Javadoc information...
[-doclet, BADoclet]
[-docletpath, C:\Program Files (x86)\Anywhere Software\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, C:\Program Files (x86)\Anywhere Software\SimpleLibraryCompiler]
[-bootclasspath, C:\Android\platforms\android-28\android.jar]
[-classpath, C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;]
[-sourcepath, src]
[-b4atarget, C:\Users\Mike\AppData\Local\Android\B4A\AdditionalLibs\B4A\CompassView.xml]
[-b4aignore, org,com.android,com.example,com.hoho]
Ignoring: [org, com.android, com.example, com.hoho]
starting....
Working with class: compassviewwrapper.compassViewWrapper
Working with class: main.com.redinput.compassview.CompassView
No ShortName annotation found for class: CompassView
Working with class: main.com.redinput.compassview.R
No ShortName annotation found for class: R
Working with class: main.com.redinput.compassview.R.string
No ShortName annotation found for class: R.string
Working with class: main.com.redinput.compassview.R.styleable
No ShortName annotation found for class: R.styleable
finish: C:\Users\Mike\AppData\Local\Android\B4A\AdditionalLibs\B4A\CompassView.xml
40 warnings

Completed successfully.
*** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
I have attempted to replicate the "ShortName annotation" that is already in compassViewWrapper.java (as above) but that only made things much worse and prevented successful compilation. This is probably largely because I do not understand the purpose of ShortName annotation!

It does not look as if there are 40 warnings listed above, so is there a log file that shows the full set?
 

agraham

Expert
Licensed User
Longtime User
I've had trouble some while ago creating the library XML using Java 11. Erel reccommended going back to Java 8 as it was thought this was an issue with Java 11 and that BADoclet needed updating. Your issue may or may not be related, but if you have Java 8 still installed changing B4A to use it might be worthwhile. Note that LibraryCompiler picks up the Java path from the B4A IDE paths.
 

mjcoon

Well-Known Member
Licensed User
I've had trouble some while ago creating the library XML using Java 11. Erel reccommended going back to Java 8 as it was thought this was an issue with Java 11 and that BADoclet needed updating. Your issue may or may not be related, but if you have Java 8 still installed changing B4A to use it might be worthwhile. Note that LibraryCompiler picks up the Java path from the B4A IDE paths.
Thanks Andrew. (Good still to be getting advice from you after all these years!)

I only have JDK 11 installed, but see I still have jdk-8u25-windows-x64.exe in my Downloads folder, from 2014, so might try installing that if a more specific cure does not emerge...

Regards, Mike.
 

mjcoon

Well-Known Member
Licensed User
I've had trouble some while ago creating the library XML using Java 11. Erel reccommended going back to Java 8 as it was thought this was an issue with Java 11 and that BADoclet needed updating. Your issue may or may not be related, but if you have Java 8 still installed changing B4A to use it might be worthwhile. Note that LibraryCompiler picks up the Java path from the B4A IDE paths.
OK, so I tried that.

The error messages from SLC v1.11 were exactly the same. However of course B4A was also running on Java-8 and did not like the library as newly compiled. The library failed to load with (brief pop-up) message:
View attachment 95817
problemWithJava-8.jpg

So that was rather retrograde!
 

agraham

Expert
Licensed User
Longtime User
B4A was also running on Java-8 and did not like the library as newly compiled
That is not the problem. I've just downloaded the original source from your link. Compiled, it with B4A using Java 8 and got no errors from SLC. However I got the same parsing error as you when trying to load it into the IDE. The problem is that the library is compiling in the base Compass View class and the Doclet is pulling in all the methods from that class. It will work, it did for me, if you add main.com.redinput.compassview to the -b4aignore list in SLC and use Java 8. Note that the list is comma separated.

EDIT: It will compile OK under OpenJDK 11 but not 14!

FURTHER EDIT: I would suggest using Java 8 as the resulting library should work under all current Java versions.
 
Last edited:
Top