B4J Question B4J Packager 11 Standalone and even the new Integrated one. Error build

DonManfred

Expert
Licensed User
Longtime User
I am doing a wrapper for JDA (JavaDiscordApi).
It comes with a jar including all dependencies.

Using this when running the App from the IDE works fine (UI App).
But when i try to build a standalone exe it stops with the error that it can not find a dependency like Jackson Databind.

I then switched to single jars. Starting with the JDA jar without any dependency.
To get the app running from the IDE i need to add some jars. Doing this with some #additionaljar directives.

When i try to build a standalone exe it comes up with the same error not finding the dependencies.

Do i need to place the jars added by additionaljar at a special place (folder) for the internal packager to be able to find them???

B4JPackager11 Version 1.20
Exe name: ORCBotUI.exe
InputJar: E:\B4J\Projekte\ORC\ORCBotUI\Objects\ORCBotUI.jar
Running: E:\B4J\Projekte\ORC\ORCBotUI\Objects\temp\FindDosPath.exe
.
Running: C:\Java\jdk-14.0.1\bin\jar
Package name: b4j.example
Running: C:\Java\jdk-14.0.1\bin\jdeps
.
.
.
.
.
.
.
.
Exception in thread "main" java.lang.module.FindException: Module com.fasterxml.jackson.annotation not found, required by com.fasterxml.jackson.databind
at java.base/java.lang.module.Resolver.findFail(Resolver.java:894)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:422)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:256)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)

B4X:
#AdditionalJar:JDA-4.1.1_152.jar
'#AdditionalJar:JDA-4.1.1_DEV-withDependencies.jar
#AdditionalJar: mysql-connector-java-5.1.34-bin
#AdditionalJar: jackson-databind-2.10.0.jar
#AdditionalJar: jackson-core-2.10.1.jar
#AdditionalJar: jackson-annotations-2.11.0.jar
#AdditionalJar: okhttp-3.13.0.jar
#AdditionalJar: slf4j-api-1.7.25.jar
#AdditionalJar: slf4j-jdk14-1.7.25.jar
#AdditionalJar: commons-collections4-4.1.jar
#AdditionalJar: okio-2.6.0.jar
#AdditionalJar: kotlin-stdlib-1.3.41.jar
#AdditionalJar: kotlin-stdlib-jdk8-1.3.41.jar
#AdditionalJar: nv-websocket-client-2.9.jar
#AdditionalJar: trove4j-3.0.3.jar

Using this additionaljars it works when running the app from the IDE.

PD: I had the issue with the standalone packager but havn´t had the time to report it. I then saw the B4J Beta announcement and i tired again. With the same issue. So now i created this thread.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Build a package. Do you get this error?
Yes.

B4JPackager11 Version 1.20
Exe name: test.exe
InputJar: E:\b4jtest\Objects\test.jar
Running: E:\b4jtest\Objects\temp\FindDosPath.exe
Running: C:\Java\jdk-14.0.1\bin\jar
Package name: b4j.example
Running: C:\Java\jdk-14.0.1\bin\jdeps
Exception in thread "main" java.lang.module.FindException: Module com.fasterxml.jackson.annotation not found, required by com.fasterxml.jackson.databind
at java.base/java.lang.module.Resolver.findFail(Resolver.java:894)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:422)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:256)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)

Download the 3 files with this link please.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Open jackson-databind-2.10.1.jar and delete module-info.class. It will then build successfully. I expect it to work though you should of course test it.
It does not raise the old error. But it stuck now.

B4JPackager11 Version 1.20
Exe name: ORCBotUI.exe
InputJar: E:\B4J\Projekte\ORC\ORCBotUI\Objects\ORCBotUI.jar
Running: E:\B4J\Projekte\ORC\ORCBotUI\Objects\temp\FindDosPath.exe
Running: C:\Java\jdk-11.0.1\bin\jar
Package name: b4j.example
Running: C:\Java\jdk-11.0.1\bin\jdeps
.
Explicitly excluded modules: [javafx.web]
Included modules: [com.fasterxml.jackson.annotation, com.fasterxml.jackson.core, java.base, java.desktop, java.logging, java.sql, java.xml]
Running: C:\Java\jdk-11.0.1\bin\javac
Running: C:\Java\jdk-11.0.1\bin\jar
.
.
.
Running: C:\Java\jdk-11.0.1\bin\jlink
.
Error: Module com.fasterxml.jackson.annotation not found
 
Upvote 0
Top