0

I am using intellij idea 12.1.4 for developing javafx applications.Whenever I build artifacts for it with external libraries, I see a lib folder containing libraries and the main jar file which is in same location as lib folder(not inside lib).

I was wondering if there is a way to package all into one jar file. I am not sure if intellij idea 14 allows us to pack into one jar file. I am open to any third party utility that can do the same thing. Also is it possible via any jar2exe utility so that Main.jar file and lib folders are merged into one exe distributable?

EDIT

This link outlines how to package javafx projects in intellij idea 12. Note that its different from packaging a normal java project.

rahulserver
  • 10,411
  • 24
  • 90
  • 164
  • Have a look at this http://stackoverflow.com/questions/24264811/combinate-jar-library-with-my-jar/24270655#24270655 .Remember to choose `extract to the target jar` under `Jar files from libraries` – ItachiUchiha Jan 29 '15 at 06:05
  • @ItachiUchiha intellij idea has different way to packaging javafx jar files. Also maven projects do not work with javafx in intellij idea. – rahulserver Jan 29 '15 at 06:06
  • The link does work for JavaFX projects. Are you talking about the `jfxrt.jar`? I don't get you, can be briefly explain. – ItachiUchiha Jan 29 '15 at 06:08
  • IntelliJ.. always ahead of others. Anyways, it has some features for pre-processing and post-processing. You can give the link I posted a try. It should work for you as well. I don't have a IntelliJ Idea at my disposal right now to help you further. – ItachiUchiha Jan 29 '15 at 06:44
  • This is kind of two questions - how to create a single jar and how to create an exe. I like one question in a question better. Anyway, I'll just address the exe bit here: the IntelliJ JavaFX artifact tab has a [native bundle option for generating an exe](https://www.jetbrains.com/idea/help/java-fx-tab.html), that will get you a [self-contained application package](http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html). – jewelsea Jan 29 '15 at 09:40
  • @jewelsea thanks for your answer. But I need to pack everything into one exe/jar. The native bundle gives a directory structure as given in the second link u shared. I mean I just need one exe or one jar file(with no accompanying directories. – rahulserver Jan 29 '15 at 11:31
  • A native bundle is a single file. – jewelsea Jan 29 '15 at 16:59
  • @jewelsea your link defies that comment. http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html chk the directory structure here. – rahulserver Jan 29 '15 at 20:07
  • The native bundle generated exe is a single file. It's an installer which contains all of the files needed to run the application. You run the exe and it installs the files onto the system. This is exactly the same way most software installs work for most systems. – jewelsea Jan 29 '15 at 20:17

0 Answers0