nasa / OpenVSP3Plugin

Apache License 2.0
21 stars 8 forks source link

Connection Failure #6

Closed realprimetime closed 3 years ago

realprimetime commented 3 years ago

Hello, I have followed the instructions to edit the build.bat, set the environment variables, and I can see the component in ModelCenter, but once I try and open the component, I get a Connection Failure error that says:

Unable to locate: component plug-in:SOFTWARE\Phoenix Integration\Component Plug-Ins\OpenVSP3Plugin Reason: Error: java.lang.NoClassDefFoundError: javafx/collections/ObservableList. Action: loading plug-in.

I am using JDK 8 and ModelCenter 14.0 (only version available).

Do you have any idea what I am doing wrong?

jfenbert commented 3 years ago

The plugin uses JAVAFX for the UI. The ObservableList class is part of JAVAFX and seems to be missing. There can be several reasons for this which we need to pin down. First JDK 8 is not a sufficient description of your JAVA. Unfortunately there are many variations of JAVA. The distribution from Oracle includes JAVAFX in JDK 8 (but not after 8). Other distribution such as OpenJDK don't all include JAVAFX. So the first test is to see if it will run outside of ModelCenter. From a command prompt try the OpenMDAO (or non-ModelCenter) command "java -jar OpenVSP3Pluging.jar" (this assumes you are in the folder containing the OpenVSP3Plugin.jar file). If this gives a similar error that one of the JAVAFX classes is not found then you will need to get a version of JAVA that includes JAVAFX.

realprimetime commented 3 years ago

So I was in fact getting a JavaFX error when running that line in command prompt. After I looked through my environment variables again, I realized one of them was still set to a previous version of Java 11. Once I changed this and reran the .bat file, I tried the line again and didn't get an error. Then, I tried it in ModelCenter and it works seamlessly. Thank you so much for your help!