HTML Editor

izoards

Bekanntes Mitglied
Hallo,

Ich möchte in meine Applikation einen HTML Editor einfügen.
Ich arbeite mit der JDK corretto-1.8.0_322 und Scenebuilder 8.5.0

Leider fehlt hier die Bibliothek "jfxwebkit.dll" gemäss Fehlermeldung:

Java:
SCHWERWIEGEND: Failed to load skin 'com.sun.javafx.scene.web.skin.HTMLEditorSkin' for control HTMLEditor@6d94340a
java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\xxxx\.jdks\corretto-1.8.0_322\jre\bin\jfxwebkit.dll
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1820)
    at java.lang.Runtime.load0(Runtime.java:810)
    at java.lang.System.load(System.java:1088)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
    at com.sun.webkit.WebPage.lambda$static$0(WebPage.java:133)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.webkit.WebPage.<clinit>(WebPage.java:132)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
    at javafx.scene.web.WebView.<init>(WebView.java:273)
    at com.sun.javafx.scene.web.skin.HTMLEditorSkin.<init>(HTMLEditorSkin.java:272)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at javafx.scene.control.Control.loadSkinClass(Control.java:735)
    at javafx.scene.control.Control$4.invalidated(Control.java:661)
    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:109)
    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:144)
    at javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:83)
    at javafx.scene.control.Control$4.set(Control.java:653)
    at javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:69)
    at javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:45)
    at javafx.scene.web.HTMLEditor.<init>(HTMLEditor.java:54)
    at FlowSys.MyTestBeforeImplement.start(MyTestBeforeImplement.java:17)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$3(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:750)

Das Beispiel habe ich aus dem Tutorial von https://jenkov.com/tutorials/javafx/htmleditor.html

Funktioniert der HTML Editor mit Java 8 nicht?
Gibt es eine Möglichkeit, den HTML Editor trotzdem zu verwenden?
Fehlt hier eine Abhängigkeit? Oder muss ich eine andere JDK wählen?

Danke für die Hilfe.
 
hast du die javafx web erwetierung hinzugefügt als dependency?

Java:
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-web -->
<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-web</artifactId>
    <version>19</version>
</dependency>
zb für maven oder wenn du es über den class path machst musst du da javafx web hinzufügen

die version musst du anpassen... ich weis nicht genau wie das mit javafx in java 8 ist da war die situation noch anders
 
Ja, hat aber nichts genützt...
Hab jetzt die Liberica JDK von BellSoft geholt, welche JavaFX bereits integriert hat.
Nun funktionierts....
 
In Java 8 war JavaFX eigentlich noch Bestandteil vom JDK. So kommt Corretto von Amazon in der 8er Version auch mit JavaFX.

Aber ohne Codecs und Webkit:

Das macht also das eigentliche Problem aus.

Was für Möglichkeiten sehe ich:
a) Ein anderes JDK von Java 8 nutzen, das hier komplett ist. Hier fällt mir z.B. von Belsoft das Liberica ein: https://bell-sw.com/ - bitte beim Download darauf achten, dass das "Full JDK" und nicht das "Standard JDK" herunter geladen wird.

b) wozu ich immer raten würde: Aktuelle Versionen nutzen, also einfach ein halbwegs aktuelles JDK (17 oder 19) und dann die Abhängigkeiten per Maven oder Gradle.

Wie so ein Maven Projekt aussehen kann, zeige ich auf GitHub: https://github.com/kneitzel/JavaFXMavenApp
Aber man kann auch einfach dem Getting Started auf openjfx.io folgen.
 

Zurück
Oben