我有JXBrowser的免费评估许可证,并且一直按照IntelliJ(https://jxbrowser.support.teamdev.com/support/solutions/articles/9000012869-jxbrowser-in-intellij-idea)的说明启动并运行HelloWorld示例:
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserCore;
import com.teamdev.jxbrowser.chromium.internal.Environment;
import com.teamdev.jxbrowser.chromium.javafx.BrowserView;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class HelloWorld extends Application {
@Override
public void init() throws Exception {
// On Mac OS X Chromium engine must be initialized in non-UI thread.
if (Environment.isMac()) {
BrowserCore.initialize();
}
}
@Override
public void start(Stage primaryStage) {
Browser browser = new Browser();
BrowserView browserView = new BrowserView(browser);
StackPane pane = new StackPane();
pane.getChildren().add(browserView);
Scene scene = new Scene(pane, 500, 400);
primaryStage.setTitle("JxBrowser: JavaFX - Hello World");
primaryStage.setScene(scene);
primaryStage.show();
browser.loadHTML("<html><body><h1>Hello World!</h1></body></html>");
}
public static void main(String[] args) {
launch(args);
}
}
所有jxbrowser东西和license.jar都被添加到项目依赖项中,但我仍然得到
Exception in Application init method
Exception in thread "main" java.lang.RuntimeException: Exception in Application init method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
at com.teamdev.jxbrowser.chromium.internal.ipc.IPC.getDefault(SourceFile:44)
at com.teamdev.jxbrowser.chromium.BrowserCore.initialize(SourceFile:51)
at JXBrowserApp.init(JXBrowserApp.java:15)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
... 2 more
Caused by: java.lang.RuntimeException: JxBrowser license check failed: No valid license found.
我正在使用OS X El Capitan版本10.11.4和IntelliJ版本2016.1.3以及java 8u101。
任何知道问题可能是什么或如何解决问题的人?
答案 0 :(得分:0)
我想原因是这个免费的JxBrowser 30天评估许可证已经过期。
答案 1 :(得分:0)
>>> '\'"'
'\'"'
>>> "'\"'
'\'"'
适用于JX浏览器(版本6)的旧版本。对于 7.1版,不使用license.jar
。相反,许可证密钥将插入代码本身:
license.jar