Usage feedback: jnativescan

Danish Nawab dnawab at outlook.com
Fri Apr 4 16:58:05 UTC 2025


jnativescan terminates when ran on a JAR with a missing class.
Example:

```
jnativescan --class-path reactor-core-3.7.4.jar

ERROR: Error while processing method: reactor.core.publisher.CallSiteSupplierFactory$SharedSecretsCallSiteSupplierFactory$TracingException::get()String
CAUSED BY: System class can not be found: sun.misc.JavaLangAccess
```

(above jar downloaded from [1])

The offending class seems to refer to a now unavailable sun.misc.JavaLangAccess but still handles this error scenario silently [2]

Because jnativescan terminates early, I can't say whether or not this library uses native/restricted features. Perhaps it would be better if instead of terminating, jnativescan continued the analysis after warning about the missing class.

Also, the above JAR seems to be a Multi-Release Jar, where the Java 11+ version of the code does not even refer sun.misc.JavaLangAccess [3].
Should jnativescan have special handling for Multi-Release JARs by analysing the version that would be applicable for the current JDK?

Versions:
```
java --version
openjdk 24 2025-03-18
OpenJDK Runtime Environment (build 24+36-3646)
OpenJDK 64-Bit Server VM (build 24+36-3646, mixed mode, sharing)

jnativescan --version
24
```

Overall, jnativescan is extremely helpful in finding the dependencies using native/restricted features.

[1] https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.7.4/reactor-core-3.7.4.jar
[2] https://github.com/reactor/reactor-core/blob/7dee739/reactor-core/src/main/java/reactor/core/publisher/CallSiteSupplierFactory.java#L56-L64
[3] https://github.com/reactor/reactor-core/blob/0b93178/reactor-core/src/main/java11/reactor/core/publisher/CallSiteSupplierFactory.java

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250404/bd7b8e02/attachment.htm>


More information about the core-libs-dev mailing list