Android Question Library creation

WebQuest

Active Member
Licensed User
Hi community I'm trying to create a library with eclipse I followed Erel's tutorial on creating a b4a library with eclipse but when generating the jar file with 'generate javac' I get a compilation error does anyone know how to solve? I state that I do not use SLC because the browser is blocking the download.

Java:
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:1017)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
    at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:514)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:422)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:416)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:415)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.loadDocletClass(Start.java:758)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.preprocess(Start.java:727)
    at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:374)
    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:435)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 16 more
 

Attachments

  • screen3.PNG
    screen3.PNG
    73.2 KB · Views: 247
Last edited:

WebQuest

Active Member
Licensed User
Hi Erel thanks for the reply. I am using SLC I indicated the library path but I get this error:
[CODE = b4x] Fase iniziale: compilazione del codice Java.
javac 14.0.1

Completato con successo.
Fase iniziale: creazione del file jar.
Accesso al percorso 'C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ Libraries \ FristLib.jar' negato.
Codice di errore]

screen4.PNG
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Hi Erel thanks for the reply. I am using SLC I indicated the library path but I get this error:
[CODE = b4x] Fase iniziale: compilazione del codice Java.
javac 14.0.1

Completato con successo.
Fase iniziale: creazione del file jar.
Accesso al percorso 'C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ Libraries \ FristLib.jar' negato.
Codice di errore]

View attachment 102015
Did you start in administrator mode so that you also have access to folders that are not in documents?
 
Upvote 0

WebQuest

Active Member
Licensed User
I ran as administrator and configured the additional libraries folder now I get this error:

Starting step: Compiling Java code.
javac 14.0.1

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:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:514)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:422)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:416)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:415)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.loadDocletClass(Start.java:758)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.preprocess(Start.java:727)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:374)
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:435)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 16 more

Error.
 
Upvote 0

WebQuest

Active Member
Licensed User
I currently have jdk14 the latest version of java. I have set the b4a paths to jdk8. But keep getting the same error about compiling the xml file.
 
Upvote 0

WebQuest

Active Member
Licensed User
Starting step: Compiling Java code.
Error: Could not find or load main class com.sun.tools.javac.Main


Error.
 
Upvote 0

cjpryor

Active Member
Licensed User
Looks like the doclet tool is missing from OpenJDK. You will need to install Oracle Java 8 and configure B4A to use it.

@Erel

I am encountering this same error trying to build a Library for B4J. Are you suggesting that we use Java 8 for a jar that we want to reference in B4J? I am a little concerned about that because I do not think it will make it through the Apple notarization process. The reason I "know" this is because I have an old program that uses Java 8 and I could not notarize it through Apple because of that.

For reference, this is my attempt at using SLC.

SLC_Error.png


Thank you.
 
Upvote 0
Top