apache / apache/maven-mvnd

java.lang.ExceptionInInitializerError & java.lang.NoClassDefFoundError (Linux)

Open
#1,262 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

Running `mvnd -v` I get the following output:

```
Apache Maven Daemon (mvnd) 2.0.0-rc-1 linux-amd64 native client (39127a46697aa1f64d19b106f943a1a13c9f1637)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jni.linux.LinuxNativePty
java.lang.ExceptionInInitializerError: null
```

Running the command again gives me:
```
Apache Maven Daemon (mvnd) 2.0.0-rc-1 linux-amd64 native client (39127a46697aa1f64d19b106f943a1a13c9f1637)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jni.linux.LinuxNativePty
java.lang.NoClassDefFoundError: Could not initialize class org.mvndaemon.mvnd.nativ.CLibrary
```

JDK seems to start fine (`mvnd --status`):
```
ID PID Address Status RSS Last activity Java home
a20ab7f2 29901 inet:/127.0.0.1:41293 Idle 83m 2025-02-08T20:59:39.253 /home/miikka/.sdkman/candidates/java/21.0.6-amzn
```

I am using Fedora 41. JDK:
```
openjdk version "21.0.6" 2025-01-21 LTS
OpenJDK Runtime Environment Corretto-21.0.6.7.1 (build 21.0.6+7-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.6.7.1 (build 21.0.6+7-LTS, mixed mode, sharing)
```

Related to #872 ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with `mvnd -v` on Fedora 41 using the reported JDK, then inspect initialization of `org.mvndaemon.mvnd.nativ.CLibrary` and the Linux native-client path. Compare the behavior with related issue #872; done means `mvnd -v` completes without `ExceptionInInitializerError` or `NoClassDefFoundError`.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
build-system, cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.