Unable to build latest weasis source code

46 views
Skip to first unread message

Meer Asgar Hussain Bahawdeen

unread,
May 5, 2026, 9:22:53 AMMay 5
to dcm4che
Hi all,

After building the latest Weasis source code, while building the native binaries and installers, getting the following error.

$ ./build/script/package-weasis.sh --jdk "/usr/lib/jvm/jdk-25.0.3+9"
rootdir: /home/demo/Weasis_466/weasis-native
Error: Could not find or load main class org.weasis.core.util.NativeLibrary
Caused by: java.lang.ClassNotFoundException: org.weasis.core.util.NativeLibrary

ERROR: Cannot get Java system architecture


I tried in Linux and Windows with both Git Bash and Cygwin, getting the same error.

Please assist me on this.

Meer Asgar Hussain Bahawdeen

unread,
May 6, 2026, 9:49:25 AMMay 6
to dcm4che
Could someone please assist me on this issue?

Hyder Zaman

unread,
May 8, 2026, 3:02:23 AMMay 8
to dcm...@googlegroups.com

Install OpenJDK 17

Ubuntu/Debian:

sudo apt update
sudo apt install openjdk-17-jdk -y

Check:

java -version

Should show something like:

openjdk version "17"

Then rebuild project first:

cd /home/demo/Weasis_466
./mvnw clean install

OR if using Gradle:

./gradlew build

After successful build:

cd weasis-native
./build/script/package-weasis.sh --jdk "/usr/lib/jvm/java-17-openjdk-amd64"

Also verify the class exists:

find . -name "*.jar" | xargs jar tf | grep NativeLibrary

If nothing appears, the project did not compile correctly.


--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dcm4che/0a039c66-43c0-4d80-b4d8-3c3377b582b5n%40googlegroups.com.

Hyder Zaman

unread,
May 8, 2026, 3:03:35 AMMay 8
to dcm...@googlegroups.com
  Many Java projects including Weasis do NOT yet fully support Java 25.  

On Wed, May 6, 2026 at 6:49 PM Meer Asgar Hussain Bahawdeen <asgarhu...@raster.in> wrote:

Meer Asgar Hussain Bahawdeen

unread,
May 8, 2026, 5:51:07 AMMay 8
to dcm4che
Hi,

I tried in Open JDK 17 and the same issue occurred,

$ ./build/script/package-weasis.sh --jdk "/usr/lib/jvm/java-17-openjdk-amd64"
rootdir: /home/demo/weasis-native

Error: Could not find or load main class org.weasis.core.util.NativeLibrary
Caused by: java.lang.ClassNotFoundException: org.weasis.core.util.NativeLibrary

ERROR: Cannot get Java system architecture

Thanks in advance.

Hyder Zaman

unread,
May 9, 2026, 3:22:22 AMMay 9
to dcm...@googlegroups.com

Looking at your error, the issue is clear: org.weasis.core.util.NativeLibrary can't be found, which means the Weasis JARs haven't been built yet before running the packaging script.

Here's what's happening and what you need to do:

What's Going Wrong

The package-weasis.sh script expects compiled Weasis JARs (including weasis-core-util) to already exist in your local Maven repository or a specific directory. The class org.weasis.core.util.NativeLibrary lives in the weasis-core-util module and must be compiled first.

Required Build Steps (in order)

Step 1 — Build Weasis itself with Maven first:

# Clone and build the main Weasis project
git clone https://github.com/nroduit/Weasis.git
cd Weasis
mvn clean install -Pstandard

Step 2 — Then run the native packager from the weasis-native repo:

cd /home/demo/weasis-native
./build/script/package-weasis.sh --jdk "/usr/lib/jvm/java-17-openjdk-amd64"

Answers to Your Specific Questions

1. Additional build step required? Yes — you must run mvn clean install on the main Weasis repository before running package-weasis.sh. The native packaging repo (weasis-native) is a separate repo that consumes the build artifacts.

2. Is NativeLibrary generated by Maven? Yes, it's compiled from source in the weasis-core-util module of the main Weasis repo. It is not auto-generated — it's a regular Java class that must be compiled and installed into your local ~/.m2 repository first.

3. Supported JDK version? Weasis native packaging officially supports JDK 17 (which you're already using — good). JDK 21 may work but isn't always tested. JDK 25 is too new and unsupported. Stick with 17.

Quick Checklist

# Verify the JAR exists after Maven build
ls ~/.m2/repository/org/weasis/core/weasis-core-util/

# Should show something like:
# 4.x.x/weasis-core-util-4.x.x.jar

If that directory is empty or missing, the Maven build didn't complete successfully and needs to be fixed first before the packaging script will ever work — regardless of which JDK version you use.


Nicolas Roduit

unread,
May 10, 2026, 2:41:03 PMMay 10
to dcm4che
I recommend simply following the official documentation and giving feedback if anything is wrong. As mentioned there, there is no guarantee that the current snapshot will build into the final distribution, due to ongoing changes before the next release.
The upcoming release will include many changes, which is why system builds have frequently been broken until recently. You can find the first build here.
Reply all
Reply to author
Forward
0 new messages