Giannis Krimitzas
Giannis Krimitzas

Reputation: 163

Setup JavaFx on Eclipse

I had javaFX installed on Eclipse and it was working as intended. I have decided today to upgrade java at Version 7 Update 45, download Eclipse Kepler (4.3.1) and reconfigure everything to work.

I uninstalled the previous java version I had, installed the 7.45 and downloaded Kepler. I created user library, adding the external javaFX jar file. I created a new program with just a stage and it is working within Eclipse. I exported it to a runnable jar file by packaging required libraries into generated JAR. It pops up the message "Could not find main method from given launch configuration", it creates the jar and it is not working.

I assume I did a mistake at the user library I created. I added the jfxrt.jar file as external jar from folder \Java\jdk1.7.0_45\jre\lib . While I was browsing java folder content, I saw another version of jfxrt file at java\jre7\lib directory. I added it that instead of the first one and it pops up the same error.

I have searched around and didn't find any answer.

Thank you

John

Upvotes: 0

Views: 953

Answers (2)

tomsontom
tomsontom

Reputation: 5887

Your way of exporting is not the correct one for javafx applications! You have to use the javafx packaging tool coming which javafx! See http://docs.oracle.com/javafx/2/deployment/packager.htm BTW why not using e(fx)clipse which provides you all this stuff for free. See http://www.eclipse.org/efxclipse/index.html

Upvotes: 2

Jurgen
Jurgen

Reputation: 2154

After you choose export from Eclipse and then "Runnable Jar", the next page in the dialogue on the top has a combo box (a drop down list) called "Launch configuration". From your description it looks like you have selected the wrong launch configuration.

Upvotes: 0

Related Questions