gpt4 book ai didi

java - 无法访问类 com.sun.javafx.scene.control.skin.resources.ControlResources(在模块 javafx.controls 中)

转载 作者:行者123 更新时间:2023-12-03 21:01:11 27 4
gpt4 key购买 nike

它发生在从 Java 8 迁移到 11 之后。

"C:\Program Files\Java\jdk-11.0.2\bin\java.exe" --add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix --illegal-access=permit --add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix --module-path C:\javafx-sdk-11.0.2\lib --add-modules=javafx.controls --add-modules=javafx.base --add-modules=javafx.fxml --add-modules=javafx.graphics --add-modules=javafx.media --add-modules=javafx.web --add-modules=javafx.swing -Didea.launcher.port=54331 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.8\bin" -Dfile.encoding=UTF-8 -classpath "C:\cryptoterminal\usr_desktop-client\build;C:\Program Files\javafx-sdk-11.0.2\lib\src.zip;C:\Program Files\javafx-sdk-11.0.2\lib\javafx-swt.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.web.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.base.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.fxml.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.media.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.swing.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.controls.jar;C:\Program Files\javafx-sdk-11.0.2\lib\javafx.graphics.jar;C:\javafx-sdk-11.0.2\lib\src.zip;C:\javafx-sdk-11.0.2\lib\javafx-swt.jar;C:\javafx-sdk-11.0.2\lib\javafx.web.jar;C:\javafx-sdk-11.0.2\lib\javafx.base.jar;C:\javafx-sdk-11.0.2\lib\javafx.fxml.jar;C:\javafx-sdk-11.0.2\lib\javafx.media.jar;C:\javafx-sdk-11.0.2\lib\javafx.swing.jar;C:\javafx-sdk-11.0.2\lib\javafx.controls.jar;C:\javafx-sdk-11.0.2\lib\javafx.graphics.jar;C:\cryptoterminal\usr_desktop-client\static\lib\ribbon-1.0.jar;C:\Users\vysotskiy\.m2\repository\org\controlsfx\controlsfx\11.0.0\controlsfx-11.0.0.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-base\11\javafx-base-11.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-base\11\javafx-base-11-win.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-graphics\11\javafx-graphics-11.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-graphics\11\javafx-graphics-11-win.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-media\11\javafx-media-11.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-media\11\javafx-media-11-win.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-web\11\javafx-web-11.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-web\11\javafx-web-11-win.jar;C:\Users\vysotskiy\.m2\repository\de\codecentric\centerdevice\javafxsvg\1.2.1\javafxsvg-1.2.1.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.8\batik-transcoder-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-anim\1.8\batik-anim-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-css\1.8\batik-css-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-ext\1.8\batik-ext-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-parser\1.8\batik-parser-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.8\batik-svg-dom-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.8\batik-awt-util-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.8\batik-bridge-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-script\1.8\batik-script-1.8.jar;C:\Users\vysotskiy\.m2\repository\xalan\xalan\2.7.0\xalan-2.7.0.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-dom\1.8\batik-dom-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.8\batik-gvt-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.8\batik-svggen-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-util\1.8\batik-util-1.8.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\batik-xml\1.8\batik-xml-1.8.jar;C:\Users\vysotskiy\.m2\repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar;C:\Users\vysotskiy\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\2.1\xmlgraphics-commons-2.1.jar;C:\Users\vysotskiy\.m2\repository\org\jfree\jfreechart\1.5.0\jfreechart-1.5.0.jar;C:\Users\vysotskiy\.m2\repository\org\jfree\jfreechart-fx\1.0.0\jfreechart-fx-1.0.0.jar;C:\Users\vysotskiy\.m2\repository\org\jfree\fxgraphics2d\1.6\fxgraphics2d-1.6.jar;C:\Users\vysotskiy\.m2\repository\com\thoughtworks\xstream\xstream\1.4.10\xstream-1.4.10.jar;C:\Users\vysotskiy\.m2\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;C:\Users\vysotskiy\.m2\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;C:\Users\vysotskiy\.m2\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;C:\Users\vysotskiy\.m2\repository\commons-io\commons-io\2.5\commons-io-2.5.jar;C:\Users\vysotskiy\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Users\vysotskiy\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\vysotskiy\.m2\repository\org\slf4j\slf4j-api\1.7.10\slf4j-api-1.7.10.jar;C:\Users\vysotskiy\.m2\repository\org\apache\httpcomponents\httpclient\4.5.2\httpclient-4.5.2.jar;C:\Users\vysotskiy\.m2\repository\org\apache\httpcomponents\httpcore\4.4.4\httpcore-4.4.4.jar;C:\Users\vysotskiy\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\vysotskiy\.m2\repository\org\apache\httpcomponents\httpmime\4.5.2\httpmime-4.5.2.jar;C:\Users\vysotskiy\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.0.pr1\jackson-annotations-2.10.0.pr1.jar;C:\Users\vysotskiy\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.0.pr1\jackson-databind-2.10.0.pr1.jar;C:\Users\vysotskiy\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.0.pr1\jackson-core-2.10.0.pr1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\lib_h-client\1.0-876-SNAPSHOT\lib_h-client-1.0-876-20190813.102725-1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\sublibs\lib_uni-model\1.1\lib_uni-model-1.1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\lib_infrastructure\1.0-876-SNAPSHOT\lib_infrastructure-1.0-876-20190813.102725-1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\subprojects\set_override\1.1\set_override-1.1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\lib_utils\1.0-876-SNAPSHOT\lib_utils-1.0-876-20190813.102725-1.jar;C:\Users\vysotskiy\.m2\repository\ru\novsys\lib_definition\1.0-876-SNAPSHOT\lib_definition-1.0-876-20190813.102725-1.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcprov-jdk15on\1\57\org\bouncycastle\bcprov-jdk15on\1.57\bcprov-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcprov-ext-jdk15on\1\57\org\bouncycastle\bcprov-ext-jdk15on\1.57\bcprov-ext-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcpkix-jdk15on\1\57\org\bouncycastle\bcpkix-jdk15on\1.57\bcpkix-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcprov-jdk15on\1.57\bcprov-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcmail-jdk15on\1\57\org\bouncycastle\bcmail-jdk15on\1.57\bcmail-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\bouncycastle\bcpkix-jdk15on\1.57\bcpkix-jdk15on-1.57.jar;C:\Users\vysotskiy\.m2\repository\org\apache\commons\commons-math3\3.4.1\commons-math3-3.4.1.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-controls\11.0.2\javafx-controls-11.0.2.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-controls\11.0.2\javafx-controls-11.0.2-win.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-fxml\11.0.2\javafx-fxml-11.0.2.jar;C:\Users\vysotskiy\.m2\repository\org\openjfx\javafx-fxml\11.0.2\javafx-fxml-11.0.2-win.jar;C:\Users\vysotskiy\.m2\repository\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar;C:\Users\vysotskiy\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.8\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMainV2 com.exscudo.desktop.cryptoterminal.App
WARNING: Unknown module: com.jfoenix specified to --add-exports
WARNING: Unknown module: com.jfoenix specified to --add-exports
2019-08-13 14:50:38.922 FINE [CryptoStock] : configuring...
2019-08-13 14:50:38.945 FINE [CryptoStock] CryptoStock: configuring...
2019-08-13 14:50:38.945 FINE [CryptoStock] CryptoStock: configuring...
2019-08-13 14:50:39.792 INFO [CryptoStock] >Exception in thread "main" java.lang.IllegalAccessError: class com.exscudo.desktop.cryptoterminal.i18n.Messages (in unnamed module @0x56928307) cannot access class com.sun.javafx.scene.control.skin.resources.ControlResources (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.skin.resources to unnamed module @0x56928307
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.i18n.Messages.initBundle(Messages.java:22)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.i18n.Messages.getResourceBundle(Messages.java:41)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.App.getResourceBundle(App.java:567)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.model.chartSettings.enums.StripsLocation.<clinit>(StripsLocation.java:22)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.model.chartSettings.ChartSettings.<init>(ChartSettings.java:54)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.Configuration.<clinit>(Configuration.java:346)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.App.lowLevelFirstRunOps(App.java:213)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at com.exscudo.desktop.cryptoterminal.App.main(App.java:79)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-08-13 14:50:39.808 INFO [CryptoStock] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2019-08-13 14:50:39.824 INFO [CryptoStock] > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2019-08-13 14:50:39.825 INFO [CryptoStock] > at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2019-08-13 14:50:39.826 INFO [CryptoStock] > at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)

Process finished with exit code 1

发生问题的类:
import com.exscudo.desktop.cryptoterminal.utils.PropertyLoader;
import com.sun.javafx.scene.control.skin.resources.ControlResources;

import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;

import static com.exscudo.desktop.cryptoterminal.utils.ReflectionUtils.getUnsafeFieldValue;
import static java.util.ResourceBundle.getBundle;

public abstract class Messages {

private static final String FIELD_NAME = "lookup";
private static final String BUNDLE_NAME = "bundle/strings";
private static final String CONTROLS_BUNDLE_NAME = "com/sun/javafx/scene/control/skin/resources/controls";
private static ResourceBundle BUNDLE;

private static void initBundle() {
final Locale locale = Locale.getDefault();
final ClassLoader classLoader = ControlResources.class.getClassLoader();

final ResourceBundle controlBundle = getBundle(CONTROLS_BUNDLE_NAME,
locale, classLoader, PropertyLoader.getInstance());

final ResourceBundle overrideBundle = getBundle(CONTROLS_BUNDLE_NAME,
PropertyLoader.getInstance());

final Map override = getUnsafeFieldValue(overrideBundle, FIELD_NAME);
final Map original = getUnsafeFieldValue(controlBundle, FIELD_NAME);

//noinspection ConstantConditions,ConstantConditions,unchecked
original.putAll(override);

BUNDLE = getBundle(BUNDLE_NAME, PropertyLoader.getInstance());
}

public static ResourceBundle getResourceBundle() {
if (BUNDLE == null)
initBundle();
return BUNDLE;
}

public static void clearBundle() {
BUNDLE = null;
}
}

最佳答案

跟着这些步骤:
JavaFx 库的位置= C:\Program Files\Java\javafx-sdk-11.0.2\libRun->Edit Configutration->VM Options:复制并粘贴:--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls,javafx.fxml-> Apply->OK

关于java - 无法访问类 com.sun.javafx.scene.control.skin.resources.ControlResources(在模块 javafx.controls 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57477300/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com