question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add jlink-compatible Java9/Jigsaw module-info (not automatic modules)

See original GitHub issue

Latest version has automatic modules and can be used in Java 9 projects (#114). However, this is not compatible with the jlink tool.

Steps to reproduce the problem (provide example input):

  • create a Java 9 based project that uses modules
  • Use jlink

Expected behavior:

jlink links the prokect

Actual behavior:

jlink reports an error:

> Task :link FAILED
Error: automatic module cannot be used with jlink: org.commonmark.ext.gfm.strikethrough from file:///Users/axel/.gradle/caches/modules-2/files-2.1/com.atlassian.commonmark/commonmark-ext-gfm-strikethrough/0.11.0/2b3f085711511202c380f2540760d64302c6bb7e/commonmark-ext-gfm-strikethrough-0.11.0.jar

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:25

github_iconTop GitHub Comments

3reactions
robinstcommented, Nov 11, 2022

Hey everyone. I think it’s time we modularized commonmark-java itself. I don’t think Android tooling has a problem with module-info files anymore (that was the original blocker).

I’m gonna look at @ice1000’s work as a starting point. One tricky part is going to be that until now, the classes in the internal package were accessible and I know some people have used them to extend inline parsing. If we no longer export those it’s going to be harder. But maybe this is a good point in time to actually make those things public. There’s some work that happened as part of https://github.com/commonmark/commonmark-java/issues/113 already.

I can’t commit to a time frame at this point though.

1reaction
cichtecommented, Dec 2, 2021

Thank you for the hint. I tried now all Versions from 0.13.1 up to 0.16.1 … all with the same result:

Error: automatic module cannot be used with jlink: org.commonmark from file:///C:/Users/developer/.m2/repository/com/atlassian/commonmark/commonmark/0.13.1/commonmark-0.13.1.jar
[ERROR] Command execution failed.

There is an automatic-module-name declaration in the jars manifest:

Automatic-Module-Name: org.commonmark

There ist also no module-info.java in the jar, so i think jlink isnt wrong with its suggestion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add jlink-compatible Java9/Jigsaw module-info (not automatic ...
Latest version has automatic modules and can be used in Java 9 projects (#114). However, this is not compatible with the jlink tool....
Read more >
Java 9: discovering modules - The Worldline engineering Blog
Java 9 is coming soon with a brand new (and long awaited) modular system. ... Module System (JPMS), more known by its project...
Read more >
Java 9+ modularity: The difficulties and pitfalls of migrating ...
By looking at compatibility, migration issues, and techniques, explore the new APIs and tools, changes, deletions, and deprecations in Java ...
Read more >
jlink not using automatic modules - Stack Overflow
You can't use jlink directly because it does not support automatic modules but this problem can be avoided by just not using the...
Read more >
Moving to Java 9 - module-info.class not found for <module ...
%JAVA_HOME%/jmods;target\terminalfx.jar;target\dependency --add-modules ... I suspect jackson.databind is an automatic module. jlink does not
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found