You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seem to be any version, tested it on 2.13.13, 3.3.3, 3.4.0 and 3.4.1
Minimized code
Strange thing is, Intellij IDEA runs this application without any problem, but when launching it via console (using the same command IDEA uses) or building with sbt-native-packager, the error occurs. Happens only if classpath contains jars with "_" symbol.
build.sbt:
ThisBuild/ version :="0.1.0-SNAPSHOT"ThisBuild/ scalaVersion :="3.4.1"lazyvalroot= (project in file("."))
.settings(
name :="TestPackaging",
libraryDependencies +="co.fs2"%%"fs2-core"%"3.10.1",
libraryDependencies +="co.fs2"%%"fs2-io"%"3.10.1"
).enablePlugins(JavaAppPackaging)
Compile/ unmanagedJars ++= {
valbase= baseDirectory.value
valcustomJars= base /"../javafx-sdk-18/lib"**"*.jar"
customJars.classpath
}
java.lang.module.FindException:Unable to derive module descriptor for ..\lib\co.fs2.fs2-core_3-3.10.1.jar
Causedby: java.lang.IllegalArgumentException: co.fs2.fs2.core.2.13:Invalid module name: '3' is not a Java identifier
Expectation
Application should not encounter any problems. I used the same configuration in the past and it worked just fine, so the issue might lie in newer version of sbt or Intelllij IDEA.
Update
Managed to fix the issue by editing ''META-INF/MANIFEST.MF'' inside every jar containing _3 in its name. Needed to append line "Automatic-Module-Name: ${new_module_name}" (provided it didn't have such line ). So, for example MANIFEST.MF for co.fs2.fs2-core_3-3.10.1.jar received one new line: "Automatic-Module-Name: co.fs2.fs2.core". New module name should follow package naming convention specified here. So, no hyphens, underscores or numbers instead of words. Needless to say all of this was extremely tedious, time-consuming and completely non-intuitive, so I would really like to see a more permanent and elegant solution implemented in sbt. I've seen there was some discussion about this and some solution apparently was implemented, but it doesn't work for each and every case, clearly
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
Seem to be any version, tested it on 2.13.13, 3.3.3, 3.4.0 and 3.4.1
Minimized code
Strange thing is, Intellij IDEA runs this application without any problem, but when launching it via console (using the same command IDEA uses) or building with sbt-native-packager, the error occurs. Happens only if classpath contains jars with "_" symbol.
build.sbt:
MainApp.scala:
Output
Expectation
Application should not encounter any problems. I used the same configuration in the past and it worked just fine, so the issue might lie in newer version of sbt or Intelllij IDEA.
Update
Managed to fix the issue by editing ''META-INF/MANIFEST.MF'' inside every jar containing _3 in its name. Needed to append line "Automatic-Module-Name: ${new_module_name}" (provided it didn't have such line ). So, for example MANIFEST.MF for co.fs2.fs2-core_3-3.10.1.jar received one new line: "Automatic-Module-Name: co.fs2.fs2.core". New module name should follow package naming convention specified here. So, no hyphens, underscores or numbers instead of words. Needless to say all of this was extremely tedious, time-consuming and completely non-intuitive, so I would really like to see a more permanent and elegant solution implemented in sbt. I've seen there was some discussion about this and some solution apparently was implemented, but it doesn't work for each and every case, clearly
The text was updated successfully, but these errors were encountered: