Package Details: java-openjfx-license 23.0.2.u3-2

Git Clone URL: https://aur.archlinux.org/java-openjfx-nowebkit.git (read-only, click to copy)
Package Base: java-openjfx-nowebkit
Description: License for Java OpenJFX client application platform (open-source implementation of JavaFX) - version following latest major Arch Linux OpenJDK java release.
Upstream URL: https://wiki.openjdk.java.net/display/OpenJFX/Main
Licenses: GPL-2.0-only WITH Classpath-exception-2.0
Provides: java-openjfx-license
Submitter: dreieck
Maintainer: dreieck (Freso)
Last Packager: dreieck
Votes: 1
Popularity: 0.80
First Submitted: 2024-07-23 15:33 (UTC)
Last Updated: 2025-03-22 11:38 (UTC)

Dependencies (25)

Required by (1)

Sources (3)

Pinned Comments

dreieck commented on 2025-03-22 11:26 (UTC)

I know that version 24.x is out, but I cannot get it building. Throws error like Cannot invoke method trim() on null object.

If anyone succeeds building it locally, please tell.

dreieck commented on 2024-07-23 15:38 (UTC)

This -nowebkit variant is here since disabling webkit support seems to work around build failure, see ↗ this comment.

Latest Comments

frankspace commented on 2025-03-22 21:19 (UTC)

This is the PKGBUILD that worked for me:

pkgbase="java-openjfx-nowebkit"
pkgname=(
  "java-openjfx-nowebkit"
  "java-openjfx-doc"
  "java-openjfx-src"
)
_jfxver=24
_jfxtag=29
# I cannot for the life of me figure out their wacky versioning system so this is pure guesswork:
pkgver=${_jfxver}.0.0.u${_jfxtag}
pkgrel=0.1
pkgdesc="Java OpenJFX client application platform built without WebKit support."
arch=(x86_64 x86_64_v3)
url="https://wiki.openjdk.java.net/display/OpenJFX/Main"
license=('GPL-2.0-only WITH Classpath-exception-2.0')
makedepends=(
  "alsa-lib"
  "ant"
  "cairo"
  "cmake"
  "ffmpeg4.4"
  "freetype2"
  "gdk-pixbuf2"
  "glib2"
  "gperf"
  "gradle=8.13-1.1"
  "gtk2"
  "gtk3"
  "java-environment-openjdk=23"
  "libgl"
  "libx11"
  "libxtst"
  "libxxf86vm"
  "pango"
  "perl"
  "python"
  "qt5-base"
  "ruby"
  "unzip"
  # "webkit2gtk"
  "zip"
)
options=(!lto)
source=(
  "https://github.com/openjdk/jfx/archive/refs/tags/jfx-${_jfxver}-${_jfxtag}.tar.gz"
  gradle.properties
  java-openjfx-flags.patch
)
b2sums=('c4f6ff072943702f7431933c2755da0457788d389a90a00c0ab63ede5cc05bdcc5067e7a7bb1ca473543abdc36e12fcf672fd90c74f88bc8673e81793d8f3b91'
        '0c023ef99e7ee600710c54dad0ad59070620595109ca42c5057fa2ab74ef6d244631745f5cd4c1bea9c0321ee69f1e1efaab820ff124ad1d4f453121e77fd14f'
        '5b6dafc22995b57564fda89aaedeb2b6ee58b2c635336ac43a123ea4ac6ced3a20eba39d99cc4eb7ec7b29fc7541f5c3bee454ee55ca79fd2d7ce5ef4ed65cd3')

_jfxdir=jfx-${_jfxver}-${_jfxtag}

prepare() {
  cd "${_jfxdir}"

  # Clean from potential previous runs
  gradle --stop
  rm -rf build
  gradle clean || true

  ln -svf ../gradle.properties .
  patch -Np1 --follow-symlinks -i ../java-openjfx-flags.patch
  sed 's|, "-Werror"||g' -i buildSrc/linux.gradle
}

build() {
# Workaround for GCC 14?  See https://aur.archlinux.org/packages/java21-openjfx#comment-993098
  _FIXWERROR_GCC14="-Wno-error=incompatible-pointer-types -Wno-error=sign-compare -Wno-error=int-conversion"
  _SILENCEWARNINGS="-Wno-incompatible-pointer-types -Wno-sign-compare -Wno-int-conversion -Wno-missing-field-initializers -Wno-cast-function-type -Wno-discarded-qualifiers -Wno-deprecated-copy -Wno-missing-field-initializers -Wno-stringop-truncation -Wno-return-local-addr -Wno-dangling-pointer -Wno-address -Wno-switch -Wno-deprecated-declarations -Wno-stringop-overread -Wno-expansion-to-defined -Wno-array-bounds"
  _CFLAGSADDITIONS=" ${_FIXWERROR_GCC14} ${_SILENCEWARNINGS}"
  CFLAGS+="${_CFLAGSADDITIONS}"
  CXXFLAGS+="${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  # Suppress errors with lld >= 17 due to undefined symbols, see https://aur.archlinux.org/packages/java-openjfx#comment-980178
  _FIXLDERROR="-Wl,--undefined-version"
  LDFLAGS+=" ${_FIXLDERROR}"
  export LDFLAGS

  cd "${_jfxdir}"

  # Build with openjdk-(current version minus 1)
  export PATH="/usr/lib/jvm/java-$((${_jfxver}-1))-openjdk/bin/:$PATH"

  # build against ffmpeg4.4
  export PKG_CONFIG_PATH='/usr/lib/ffmpeg4.4/pkgconfig'

  # Workaround for situation where the linker treats whitespace as arguments
  export LDFLAGS="${LDFLAGS//+([[:space:]]|[[:blank:]])/ }"

  gradle zips
}

package_java-openjfx-nowebkit() {
  pkgdesc="Java OpenJFX client application platform without WebKit support."
  depends=(
    "freetype2"
    "glib2"
    "glibc"
    "java-runtime-openjdk=${_jfxver}"
    "libgl"
    "libx11"
    "libxtst"
  )
  optdepends=(
    "ffmpeg4.4: Media support"
    'gtk2: GTK2 support'
    'gtk3: GTK3 support'
  )
  provides=(java-openjfx=${_jfxver})

  cd "${_jfxdir}"

  install -dvm 755  "${pkgdir}"/usr/{lib/jvm/java-${_jfxver}-openjfx,share/licenses}
  cp -dvr --no-preserve=ownership build/sdk/lib "${pkgdir}"/usr/lib/jvm/java-${_jfxver}-openjfx/
  cp -dvr --no-preserve=ownership build/jmods "${pkgdir}"/usr/lib/jvm/java-${_jfxver}-openjfx/
  cp -dr --no-preserve=ownership build/sdk/legal "${pkgdir}"/usr/share/licenses/java-openjfx
}

package_java-openjfx-doc() {
  pkgdesc="Documentation for Java OpenJFX client application platform"
  arch=(any)
  cd "${_jfxdir}"

  install -dvm 755 "${pkgdir}"/usr/share/{doc,licenses}
  cp -dvr --no-preserve=ownership build/javadoc "${pkgdir}"/usr/share/doc/java-openjfx
  install -vm 644 -t "${pkgdir}"/usr/share/doc/java-openjfx  README.md UPDATING-VERSION.md WEBKIT-MEDIA-STUBS.md CONTRIBUTING.md
  ln -sv java-openjfx "${pkgdir}"/usr/share/licenses/java-openjfx-doc
}

package_java-openjfx-src() {
  pkgdesc="Source code for Java OpenJFX client application platform"
  arch=(any)
  cd "${_jfxdir}"

  install -dvm 755  "${pkgdir}"/usr/{lib/jvm/java-${_jfxver}-openjfx,share/licenses}
  install -vm 644 build/sdk/src.zip "${pkgdir}"/usr/lib/jvm/java-${_jfxver}-openjfx/javafx-src.zip
  ln -sv java-openjfx "${pkgdir}"/usr/share/licenses/java-openjfx-src
}

frankspace commented on 2025-03-22 19:17 (UTC) (edited on 2025-03-22 21:03 (UTC) by frankspace)

I got this to compile, but it was super annoying. Here's what I did:

OpenJFX now has a hard dependency on OpenJDK>=22, which is a problem because Arch's Gradle has a hard dependency on OpenJDK<=21. As it happens, Gradle can actually support OpenJDK<=23. So I compiled my own jdk23-openjdk package, and I then recompiled Gradle with an updated <=23 dependency. With that, I was able to compile this package in a chroot.

One additional wrinkle: there is a longstanding bug with the installation directory; this needs to install to /usr/lib/jvm/java-${_jfxver}-openjfx, NOT to ...-openjdk. Otherwise you will get file conflicts; see also FS#64121.

Note that webkit is still impossible, because there's a dependency on something called webkitdirs, which is provided by WebKit proper but, for whatever reason, not provided in WebKitGTK, and I can't figure out how to fix that.

I will post the PKGBUILD that worked for me in another comment, because it's close to the 5K character limit.

dreieck commented on 2025-03-22 11:26 (UTC)

I know that version 24.x is out, but I cannot get it building. Throws error like Cannot invoke method trim() on null object.

If anyone succeeds building it locally, please tell.

pdynarowski commented on 2025-03-14 08:42 (UTC)

yes it works !

dreieck commented on 2024-11-11 21:04 (UTC)

@solonovamax,

The build currently fails due to unverified dependencies

I have no idea about this java dependency stuff.

If you (or someone else) can tell me how to fix it, please do so.

For me the build works, and I do not have the knowledge to track this down. So I did nothing to the PKGBUILD for now.

Regards!

solonovamax commented on 2024-09-25 17:23 (UTC) (edited on 2024-09-25 17:33 (UTC) by solonovamax)

Also, the build fails due to not using the project's gradlew binary and instead using the system gradle.

As-per the buildscript output:

*****************************************************************
Unsupported gradle version 8.10.1 in use.
Only version 8.5 is supported. Use this version at your own risk
*****************************************************************

nvm, this only happened due to me editing the pkgbuild to add --write-verification-metadata sha256 to fix the previous issue

solonovamax commented on 2024-09-25 17:14 (UTC)

The build currently fails due to unverified dependencies:

Using /usr/bin/gradle
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Dependency verification failed for configuration 'classpath'
23 artifacts failed verification:
  - annotations-13.0.jar (org.jetbrains:annotations:13.0) from repository Gradle Central Plugin Repository
  - annotations-13.0.pom (org.jetbrains:annotations:13.0) from repository Gradle Central Plugin Repository
  - gradle-versions-plugin-0.11.1.pom (com.github.ben-manes:gradle-versions-plugin:0.11.1) from repository MavenRepo
  - gradle-versions-plugin-0.51.0.jar (com.github.ben-manes:gradle-versions-plugin:0.51.0) from repository Gradle Central Plugin Repository
  - gradle-versions-plugin-0.51.0.module (com.github.ben-manes:gradle-versions-plugin:0.51.0) from repository Gradle Central Plugin Repository
  - kotlin-reflect-1.9.24.jar (org.jetbrains.kotlin:kotlin-reflect:1.9.24) from repository Gradle Central Plugin Repository
  - kotlin-reflect-1.9.24.pom (org.jetbrains.kotlin:kotlin-reflect:1.9.24) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-1.9.24.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.24) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-1.9.24.module (org.jetbrains.kotlin:kotlin-stdlib:1.9.24) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-common-1.9.24.module (org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-jdk7-1.8.21.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-jdk7-1.8.21.pom (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-jdk8-1.8.21.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21) from repository Gradle Central Plugin Repository
  - kotlin-stdlib-jdk8-1.8.21.pom (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21) from repository Gradle Central Plugin Repository
  - moshi-1.12.0.jar (com.squareup.moshi:moshi:1.12.0) from repository Gradle Central Plugin Repository
  - moshi-1.12.0.module (com.squareup.moshi:moshi:1.12.0) from repository Gradle Central Plugin Repository
  - moshi-kotlin-1.12.0.jar (com.squareup.moshi:moshi-kotlin:1.12.0) from repository Gradle Central Plugin Repository
  - moshi-kotlin-1.12.0.module (com.squareup.moshi:moshi-kotlin:1.12.0) from repository Gradle Central Plugin Repository
  - okhttp-4.11.0.jar (com.squareup.okhttp3:okhttp:4.11.0) from repository Gradle Central Plugin Repository
  - okhttp-4.11.0.module (com.squareup.okhttp3:okhttp:4.11.0) from repository Gradle Central Plugin Repository
  - okio-3.2.0.module (com.squareup.okio:okio:3.2.0) from repository Gradle Central Plugin Repository
  - okio-jvm-3.2.0.jar (com.squareup.okio:okio-jvm:3.2.0) from repository Gradle Central Plugin Repository
  - okio-jvm-3.2.0.module (com.squareup.okio:okio-jvm:3.2.0) from repository Gradle Central Plugin Repository
If the artifacts are trustworthy, you will need to update the gradle/verification-metadata.xml file. For more on how to do this, please refer to https://docs.gradle.org/8.10.1/userguide/dependency_verification.html#sec:troubleshooting-verification in the Gradle documentation.

Open this report for more details: file:///home/solonovamax/.cache/paru/clone/java-openjfx-nowebkit/src/jfx22u-22.0.2-4/build/reports/dependency-verification/at-1727284388481/dependency-verification-report.html

Freso commented on 2024-07-27 12:43 (UTC)

Thank you! I was meaning to make a variant (like this) or do something, just didn’t get around to it yet. Thanks for picking it up. :)

dreieck commented on 2024-07-23 15:38 (UTC)

This -nowebkit variant is here since disabling webkit support seems to work around build failure, see ↗ this comment.