Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
144 views
in Technique[技术] by (71.8m points)

java - Export JavaFX Project to a runnable using Eclipse

I'm using Eclipse and making a simple game in javaFX. I have images and need to package them and the javafx into a runnable file. I am not using any of the css stuff related to javafx, just the basic windows and stages and stuff. Thanks!

I have tried to just export it however it did not work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  • Part 1

    A JavaFX Eclipse Project is like:

enter image description here

So with the above you are sure that every library and resource will be in the

1)Into the final Jar

or

2)You will have a final Jar and a separate folder which contains all the external libraries you are using.

or

3) (2)+External Folder for other resources

Exporting the Project:

1)Right Click on the Project

2)Export->Java->Runnable Jar File...

enter image description here

3)Choose your main class

4)On Library Handling it is your choice(better choose the 3rd option cause it prevents conflicts on libraries which containing same classes and doesn't violate some libraries licence)

5)Export It

Finally

Also have a look at this link which was provided in the comments.

  • Part 2)

After you have done the above you can use Launch4J to package your jar file into an .exe file(for Windows)

  • Part 3)

    You can also export your JavaFX Project in a way that it can be used in windows,Mac and Linux.

    For that you can use the file build.fxbuild and build the project(big topic search for it on internet)

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...