1

I have some problems running my JavaFX8 Project with Maven. Here is the situation:

I create a Maven Java FX application within Netbeans (File --> New Project --> Maven JavaFX Application). Netbeans creates the packages and also creates a MainApp.java file.

Even if I don´t edit anything in this project, I get an error/warning within the properties.

Location: Right-Click Project --> Properties --> Run

Message: One of Run/Debug/Profile Project actions has been modified and the Run panel cannot be safely edited

The project can be built and run for some time, but after I create more packages, classes and stuff like that, I can´t run the application anymore.

It tells me, that it can´t find the Main class.

Message: Error: Could not find or load main class

I found some entries at stackoverflow and google, but none of the solutions seem to work for me.

I read this Topic for example.

One of the solutions is, to set the main class at the properties (Run), but all the fields are disabled. I also deleted the Cache, which didn´t solve the problem. I also checked the typing.

Some other sites stated, that it seems to be a bug, but they had older Netbean Versions. I updated my Netbeans version to 8.2 today.

The only solution at the moment is to create a new Maven JavaFX project and refactor the files to the new project. This works for a couple of hours but in the end the error occurs again.

Does anybody know a solution?

Community
  • 1
  • 1
Rallenaldo
  • 107
  • 8
  • What OS and JDK version are you using? Any reason you are using JavaFX 2 and not 8? – Itai Apr 06 '17 at 16:03
  • Hi. I'm using Windows 7 ultimate 64 Bit with jdk 8u_121. I think that the newest javafx Version is included. Looks like I thought it is javafx 2. Mixed it up with scene builder 2.0 I think. If I use the newest jdk (8u_121), I automaticly use the newest javafx Version, right? – Rallenaldo Apr 06 '17 at 22:36
  • Have you found a solution to your problem yet? I am facing the exact same issue and cannot figure it out. – Brian Jan 28 '20 at 17:09

1 Answers1

0

Use Run from the Project, not Run File from the main file. The latter can work on other setups, but not straight out of Maven.