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
Bit of a shot in the dark, but I have a javafx application for which i'm hoping to create cross-platform launchers. The JDKPackager plugin relies on the existence of ant-javafx.jar which as far as I can see has been dropped by openjfx.
The error that is get is unsurprisingly
[error] (JdkPackager / antBuildDefn) Please set key `JDKPackager / antPackagerTasks` to `ant-javafx.jar` path, which should be found in the `lib` directory of the Oracle JDK 8 installation. For example (Windows):
[error] JDKPackager / antPackagerTasks := Some(file("C:\\Program Files\\Java\\jdk1.8.0_45\\lib\\ant-javafx.jar"))
I'm not so much asking for sbt-native-packager to be updated to support recent versions of javafx, rather would like to know if there are any good alternatives for bundling my app using sbt.
For reference below is my build.sbt, I'm running
java 21
sbt-native-packager 1.11.0
macos arm64
sbt 1.10.2
As an aside everything works fine if I create an bash exe with JavaAppPackaging instead, but that doesn't fit my use case.
scalaVersion :="2.13.15"
libraryDependencies ++=Seq(
"org.scalafx"%%"scalafx"%"22.0.0-R33",
"io.circe"%%"circe-core"%"0.14.1",
"io.circe"%%"circe-parser"%"0.14.1"
)
libraryDependencies ++= javaFXModules
enablePlugins(JlinkPlugin)
enablePlugins(JDKPackagerPlugin)
// Add JavaFX dependencieslazyvaljavaFXModules= {
// Determine OS version of JavaFX binarieslazyvalosName= (System.getProperty("os.name"), System.getProperty("os.arch")) match {
case (n, _) if n.startsWith("Linux") =>"linux"case (n, "aarch64") if n.startsWith("Mac") =>"mac-aarch64"case (n, _) if n.startsWith("Mac") =>"mac"case (n, _) if n.startsWith("Windows") =>"win"case _ =>thrownewException("Unknown platform!")
}
Seq("base", "graphics", "media", "controls").map(m =>"org.openjfx"%s"javafx-$m"%"22" classifier osName)
}
fork :=trueCompile/ mainClass :=Some("preflop.ranger.PreflopRanger")
jdkPackagerType :="installer"
jdkPackagerToolkit :=JavaFXToolkit
jdkPackagerProperties :=Map("app.name"-> name.value, "app.version"-> version.value)
jdkPackagerAppArgs :=Seq(maintainer.value, packageSummary.value, packageDescription.value)
The text was updated successfully, but these errors were encountered:
I've figured out an alternative for myself using sbt-assembly and jpackage.
I needed to alter the merge strategy for sbt-assembly as follows to work with javafx (NB i am building on mac-aarch64, other OS will come with their own baggage):
assembly / mainClass :=Some("my.app.Main")
assembly / assemblyMergeStrategy := {
case x ifAssembly.isConfigFile(x) =>MergeStrategy.concat
casePathList(ps @_*) ifAssembly.isReadme(ps.last) ||Assembly.isLicenseFile(ps.last) =>MergeStrategy.rename
casePathList("META-INF", xs @_*) =>
(xs map { _.toLowerCase }) match {
case ("manifest.mf"::Nil) | ("index.list"::Nil) | ("dependencies"::Nil) =>MergeStrategy.discard
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>MergeStrategy.discard
case"plexus":: xs =>MergeStrategy.discard
case"services":: xs =>MergeStrategy.filterDistinctLines
case ("spring.schemas"::Nil) | ("spring.handlers"::Nil) =>MergeStrategy.filterDistinctLines
case ("substrate":: xs) =>MergeStrategy.discard //Added to default herecase _ =>MergeStrategy.deduplicate
}
case"module-info.class"=>MergeStrategy.concat //Added to default herecase _ =>MergeStrategy.deduplicate
}
Bit of a shot in the dark, but I have a javafx application for which i'm hoping to create cross-platform launchers. The JDKPackager plugin relies on the existence of
ant-javafx.jar
which as far as I can see has been dropped by openjfx.The error that is get is unsurprisingly
I'm not so much asking for sbt-native-packager to be updated to support recent versions of javafx, rather would like to know if there are any good alternatives for bundling my app using sbt.
For reference below is my
build.sbt
, I'm runningAs an aside everything works fine if I create an bash exe with
JavaAppPackaging
instead, but that doesn't fit my use case.The text was updated successfully, but these errors were encountered: