0

I'm trying to use jlfgr java -jar thejarfile --describe-module gives

Unable to derive module descriptor for: jlfgr-1_0.jar
jlfgr.1.0: Invalid module name: '1' is not a Java identifier

My current Java 11 with JFX11 module-info is like:

module FXTodo {

    requires javafx.base;
    requires javafx.controls;
    requires javafx.graphics;
    requires javafx.fxml;
    requires javax.jlfgr;

    opens com.something.todolist;
}

The jar sits uner External Libraries section along with javafx-swt that contains all the javafx stuff seen above in the module-info. Without jlfgr, it compiles and runs

Markus Steppberger
  • 618
  • 1
  • 8
  • 18
chrips
  • 4,996
  • 5
  • 24
  • 48
  • 1
    To clarify the doubts further, the cause is the name of the Jar, from which the module system is not able to derive an *Automatic-Module-Name*. – Naman Mar 09 '19 at 14:13
  • @nullpointer Well the other question is answered for Maven build. I cant change the jar name, it won't let me. – chrips Mar 10 '19 at 04:32
  • nullpointer is correct. The ModuleFinder javadoc describes how a module name is derived for JARs that don't contain an explicit module or don't have the Automatic-Module-Name attribute. It doesn't work for "jlfgr-1_0.jar" because the author of that library has used an underscore instead of dot. Has you created an issue for that library, maybe its maintainer isn't aware of modules yet and doesn't know that jlfgr-1_0.jar cannot be deployed on the module path (at least not without renaming it or changing it to add Automatic-Module-Name). – Alan Bateman Mar 10 '19 at 07:18
  • @AlanBateman OK I'll find the lead for that and see what they recommend. Thank you. – chrips Mar 10 '19 at 07:31

0 Answers0