0

When refreshing the gradle in intelIJ-IDEA, specifically in the zap-extensions folder for adding our custom plugin, we get the following error.

Could not find javafx-web-11-mac-aarch64.jar (org.openjfx:javafx-web:11).
Searched in the following locations:
    https://repo.maven.apache.org/maven2/org/openjfx/javafx-web/11/javafx-web-11-mac-aarch64.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

The error only occurs on a Macbook Pro M1, and works on other architectures.

We tried adding our own javafx jar file as an artifact in the project structure, but we can't figure out how to do this exactly. Does anyone have a clue how to solve this? Are we on the right track with adding a random javafx jar file as an artifact?

Daan Seuntjens
  • 880
  • 1
  • 18
  • 37
  • 1
    https://stackoverflow.com/a/71622655/104891 may help. – CrazyCoder Nov 14 '22 at 16:18
  • @CrazyCoder installed and adjusted jdk, but error stays – Daan Seuntjens Nov 14 '22 at 16:33
  • Make sure Maven is configured to use this JDK as well. https://i.imgur.com/SbuV0a9.png. – CrazyCoder Nov 14 '22 at 16:33
  • @CrazyCoder changing the maven jdk doesn't work either... (ps: thanks a lot tho for suggesting solutions!!) – Daan Seuntjens Nov 14 '22 at 16:40
  • Does Gradle project work without errors in the system Terminal? Can you build and run it via the command line Gradle? – CrazyCoder Nov 14 '22 at 16:41
  • That is a little vague. We run ./gradlew addOns:myaddon:copyZapAddOn (https://github.com/zaproxy/zap-extensions/blob/main/gradlew) to 'build' and copy our custom addon to the zap 'core folder' (https://github.com/zaproxy/zaproxy). Here we run ./gradlew run (https://github.com/zaproxy/zaproxy/blob/main/gradlew), which runs succesfully with the custom plugin added. Without the gradle building we get weird errors in the IDE due to not recognizing classes when importing etc. – Daan Seuntjens Nov 14 '22 at 16:51
  • If the issue occurs only in IntelliJ IDEA, but not in the command line Gradle, please file a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA with a sample project to reproduce attached. – CrazyCoder Nov 14 '22 at 16:56
  • provide the gradle.build file. Probably you are specifying a classifier in gradle for the javafx-web artifact and that classifier is wrong. There is no aarch64 support in JavaFX 11, you need a later JavaFX version, e.g. JavaFX 19 to have such support, you also need a JDK with such support (I suggest the same version as the JavaFX version you eventually choose). – jewelsea Nov 14 '22 at 19:15

1 Answers1

2

It looks like the version of JavaFX we are currently using is not supported on the M1. But it looks like JavaFX 17 may well support it: https://gluonhq.com/javafx-for-apple-m1/ You could try using that and if it works submit a PR? I dont currently have access to an M1 to test it...

Simon Bennetts
  • 5,479
  • 1
  • 14
  • 26