Scene Builder 2.0 not launching

2019-08-13 04:00发布

问题:

Someone seems to have had a similar issue before.

On a fresh install of Windows 8.1 I've installed Netbeans, the lastest JDK, and the JavaFX Scene Builder, but the Scene Builder isn't running.

Usually the issue is with the Scene Builder window not appearing/opening files, but right now I can't get it to open for a first run. No error messages, and running it from the command line doesn't return anything. The program doesn't seem to appear in the Task Manager, and there's no icon showing on the task bar.

I also have BitDefender installed (like the person in the other question), but disabling it doesn't seem to help.

回答1:

I uninstalled Scene Builder 2.0 and installed Scene Builder 1.1. It wouldn't start either, but it seems it's more verbose in it's errors. I got two errors this time: "Failed to create JVM" and "Failed to Launch JVM".

Searching those two errors led me to this post outlining a fix that worked for me. Even though I had loads of free memory the default settings attempt to set the max amount of memory for the heap to 999MBs, and it seems the JVM was failing to launch because of that.

I'm not sure what the issue with that value is but looking at the docs for the -Xmx argument: "This value must be a multiple of 1024 and greater than 1 MB". But I've used values that weren't multiples of 1024 before (On my previous installs I never had this issue, and presumably the value was 999), and 1024 itself doesn't seem to work, so I'm still not completely sure on the exact source of the issue is.

The fix mentioned in the post might have worked simply because it happened to set the value to a multiple of 1024:

  • Go to HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\oracle\javafx\scenebuilder\/J/V/M/User/Options in regedit
  • Change the value for -/Xmx from 999m to 512m


回答2:

Looks like SceneBuilder needs Java Development Kit 9. I'm using just the jar file of SceneBuilder, version 9.0.1 from Gluon, and JDK9 from Oracle which works with it.

To get it to start I use this script (file workaround.bat):

set BUILDER_PATH=c:\Work\scenebuilder-9.0.1-all.jar
set curdir="%cd%"
cd "c:\Program Files\Java\jdk-9.0.4\bin"
call java -jar %BUILDER_PATH% %1 %2 %3
cd %curdir%

Sorry I don't have NetBeans, but in Eclipse, configure JavaFX like this:

Launching using context menu then works!