Android Question Simple Library Compiler 1.13 error on Java jdk-19.0.2

wbtcpip

Member
Licensed User
Longtime User
After updating B4A to v13 and java to jdk-19.0.2 my Simple Library Compiler 1.13 fails with:

[CODE lang="b4x" highlight="Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javadoc/Doclet"]Starting step: Compiling Java code.
javac 19.0.2

Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javadoc/Doclet
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.loadDocletClass(Start.java:799)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.preprocess(Start.java:770)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:375)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:346)
at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:57)
at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:46)
Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.Doclet
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 16 more

Error.
[/CODE]
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
The error "NoClassDefFoundError: com/sun/javadoc/Doclet" is based on the fact that the java jdk 19 doesn't have the Sun based Javadoc. It is replaced by jdk.javadoc which can be found in the "src.zip" file in jdk 19 lib folder.

I suspect that version v1.13 makes a distinction between the compiler version of the B4A/B4J program (version 19 in your case) and the Java 1.8 compiler for the required XML file.

You need to use current version v1.13 of SLC which have an option to define the location of your jdk 1.8 compiler to create the required xml documentation file which is created with the Java 1.8 compiler who have included the missing com/sun/javadoc/Doclet:
1725051640219.png
 
Upvote 0

wbtcpip

Member
Licensed User
Longtime User
i think there is more because i already tried to use previous jdk versions...ex with jdk 18 i'm still having:

B4X:
Starting step: Compiling Java code.
javac 18

Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javadoc/Doclet
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
    at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.loadDocletClass(Start.java:781)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.preprocess(Start.java:752)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:371)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:342)
    at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
    at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.Doclet
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 16 more

Error.

i will try to downgrade to older versions of jdk but i hope Erel could build a new Simple Library Compiler compatible with the last jdk
 

Attachments

  • 2024-08-31_023435.jpg
    2024-08-31_023435.jpg
    161.9 KB · Views: 51
Upvote 0
Top