Java Question SLC Compiling Error

behnam_tr

Active Member
Licensed User
Longtime User
I have a Java project that runs without any problems on Eclipse, but it gives an error when compiling with SLC
B4X:
Starting step: Compiling Java code.
javac 1.8.0_381
C:\Users\Admin\eclipse-workspace\test1\src\mypackage\firstlib.java:6: error: cannot access SimpleTransferApiImpl
import ir.gov.tax.tpis.sdk.transfer.api.SimpleTransferApiImpl;
                                       ^
  bad class file: C:\Users\Admin\eclipse-workspace\test1\libs\content-0.0.34-jar-with-dependencies.jar(ir/gov/tax/tpis/sdk/transfer/api/SimpleTransferApiImpl.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.


Error.
 

Attachments

  • Untitled.png
    Untitled.png
    63.8 KB · Views: 29
Last edited:

Daestrum

Expert
Licensed User
Longtime User
It's telling you that the class was compiled to run on a later version of Java.
55 = Java 11
52 = Java 8

I believe (though I could be wrong) SLC is for Java 8.
 

behnam_tr

Active Member
Licensed User
Longtime User
It's telling you that the class was compiled to run on a later version of Java.
55 = Java 11
52 = Java 8

SLC support java 11 ??
where i can download full jdk 11
i have tested with openjdk 14 (downloaded from b4j download page) but give error

open jdk 14:
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.
 

Daestrum

Expert
Licensed User
Longtime User
On the Products page at the top of this forum page.
Products > B4J > scroll down a bit

Just noticed 11 isnt on there it's 14 now

Download 11 from Openjdk then add the javafx - make the directories layout the same as 14
 

behnam_tr

Active Member
Licensed User
Longtime User
On the Products page at the top of this forum page.
Products > B4J > scroll down a bit

Just noticed 11 isnt on there it's 14 now

Download 11 from Openjdk then add the javafx - make the directories layout the same as 14
thanks solved with jdk11
 

agraham

Expert
Licensed User
Longtime User
If SLC is producing the correct XML file compiling with JDK 11 then you are lucky. The Doclet that produces the XML can produce bad XML or throw errors during compile when used with Java versions later than 8 so where possilbe you should use SLC with Java 8.
 

behnam_tr

Active Member
Licensed User
Longtime User
If SLC is producing the correct XML file compiling with JDK 11 then you are lucky. The Doclet that produces the XML can produce bad XML or throw errors during compile when used with Java versions later than 8 so where possilbe you should use SLC with Java 8.
Yes, the compilation was done correctly with jdk11 and I also tested the library and it works without problems with jdk11
I was surprised because I had seen in some posts that it is only supported up to jdk8
 
Top