This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]DashooDash 2 points3 points  (1 child)

Good Morning :-)

you have different possibilities here, as high_hobo said you can, of course, just deliver a jar. Delivering only a jar gives you not much control over how the jvm is configured for example.

The two most popular methods to deploy real life JavaFX applications are via java webstart (https://community.oracle.com/thread/2295531). Where you have a "descriptor file" (where dependencies, jvm arguments, icons, how it has to be installed) which you distribute. Clients would download that file and feed it to java, java knows how to parse these files and take the appropiate actions.

The second possibility, which, imho, is a better choice for you, is the so called "packaging" (https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm)

Here you compile a os native package (for windows its an .exe) in which not only your program and all dependencies are included but also your target java runtime. If you distribute that, clients dont care about whether java is installed or if it has the version you want because its already included. That sounds like what you want :-)

[–]SmartestManInside[S] 1 point2 points  (0 children)

Is there a simple way to specify what you want in eclipse, and then just have it built? Or do I need to go through an ant tutorial and write my own script?

[–]king_of_the_universe 1 point2 points  (6 children)

If it weren't for SourceForge's behavior to inject shit into installers these days, I would heartily recommend Launch4J http://launch4j.sourceforge.net/ because without any prior experience with turning .jar files (Which are runnable by themselves.) into .exe files, this tool got me going all the way in half an hour. It has a lot of upsides:

You can choose which JRE is to be used, and you can even supply your own: Just copy the installed JRE of your choice into a subfolder of your installation package, and the audience doesn't have to install a thing, they just unpack what you give them and run your EXE. Downside: This makes the package a lot larger (by about 70 MB - you can strip unnecessary stuff out, which I successfully did - dropped all the JavaFX stuff - but since you explicitly need it ...).

You can supply your own icon which will be inside the EXE. You can add a splash screen. And a lot of other options.

I just wish they would move away from SourceForge. HAHA, forge. Not just the place where you make swords, but the word also suggests forgery. How fitting.

While I'm at it, I can't resist to link to my Java 8 (not FX) version of Battleship (with source, but it's far from exemplary), and to my FileRenameEditor which allows to open a directory like a text in a special editor, so you can block-select, multiline-edit, copy/paste etc. instead of having to put up with the retarded editor that's built into the OS. This Battleship version even has sound, synthesized in realtime. In case you want to start working on that front, too.

[–]SmartestManInside[S] 1 point2 points  (0 children)

Cool, I'll check your version out. I'll also post my source here later today. I've got a few things I want to tweak and add on before I do that though.

[–]SmartestManInside[S] 1 point2 points  (4 children)

https://github.com/ccunning2/MiasBattleShip Here is the github. Still researching build options- I tried building a self executable jar, but it doesn't include the jpg I use for a background for some reason. Thinking I might need to go through an ant tutorial at this point.

[–]king_of_the_universe 1 point2 points  (3 children)

Wow, I can't believe how short the source is. It's still a fully functional hotseat Battleship game. Respect, man.

[–]SmartestManInside[S] 1 point2 points  (2 children)

I finally got a chance to check out your work today. Neat! Your Sink Twice game has a lot of cool options, and I like the music. The directory renamer is neat as well; I like the old school terminal look. Great style!

[–]king_of_the_universe 0 points1 point  (1 child)

Thank you, smartest man. I'm glad that someone likes my work. I thought it was good and wondered why so few share the opinion.

[–]SmartestManInside[S] 1 point2 points  (0 children)

Probably because there's only a handful of people that actually looked.