Intellij JavaFX vs Java Project for .exe file [duplicate] - java

This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
Closed 3 years ago.
I have already a Java Project in Intellij.
I want to make a .exe Java file, but I did not find any solution yet for Java Projects. On the other hand, I have found many youtube videos in which they use a JavaFX Project to create an artifact which they will use to create a .exe file.
One of them is the following youtube video:
IntelliJ export JavaFX application to exe on Windows
My end goal is, that a user just double clicks on the file and a GUI opens. After entering some information the rest of the code should run. The file should be able to run to different windows systems, so this should not only work when installing special packages.
Did I chose the wrong type of project? To that I just read, that JavaFX will be discontinued.
I am confused in so many levels...

You should first make an executable .jar file and then use an .exe wrapper on the jar. I've used
Launch4j in the past with great success. I haven't tried it on javafx yet, but there are many executable wrappers to choose from with a quick google search. If this is at all unclear, leave a comment, and I'll detail these steps more. Launch4j has an almost self explanatory interface, so I don't think you should have trouble as long as you're sure your .jar launches.

What you're looking for is an executable jar file I think. I know that eclipse you can generate one so I'd assume you can do the same in intellij. How to

Related

Reducing the size of a java project when exporting it to an ".exe"-Application [duplicate]

This question already has answers here:
How can I convert a .jar to an .exe?
(7 answers)
Closed 3 years ago.
I currently have to take care of a Java Project (JavaFX 8). The application is finished, but my boss wants an .exe file, to click on and run the thing.
I built the .exe app from the Java source code with IntelliJ IDEA, but the folder with all the .dll files is huge (the .exe itself is tiny). My question is, if someone has experience in reducing the size of the folder, or if there is a way to make a single small .exe file.
The folder structure looks like:
|> FOLDER "app" (jar and config file)
|> FOLDER "runtime" (very huge)
|>bin
|>lib
|>some .dll and the .exe
I understand the I somehow need the JRE with the .exe file but maybe there still is a way to reduce the size of the runtime folder since the app itself is "pretty tiny".
Thanks for your help.
If you need the JRE to be packed with it you can use
Excelsior JET
It is not free though.
If you just need to package your Jar with little overhead you can use
Launch4j
You need to supply your own JRE with it though.

Java Executable Application [duplicate]

This question already has answers here:
How to make an executable JAR file?
(5 answers)
Closed 5 years ago.
I am an amateur Java programmer, and I have just started learning how Java applets work. However, I wanted to make an applet for my Chrome browser, but it no longer works because Chrome doesn't support NPAPI plugins (like Java and Unity 3D). I want to make a standalone Java executable similar to Minecraft. The idea is that once I double-click on the .jar file, it opens the application and runs the program.
The program displays text and images based on input from a text box.
How do I make the .jar automatically open on a double click?
To make a JAR which can be launched by double clicking, you have to make it an executable JAR. There must be a file META-INF/MANIFEST.MF inside the JAR with key-value pairs that point to the main class (the class with the main method) to run.
See Lesson: Packaging Programs in JAR Files in Oracle's Java Tutorials to learn exactly how to create an executable JAR.
No.
After the release of Chrome version 45, you’ll need to use an alternate web browser to load content that requires a NPAPI plugin.
But you can create application using Java Network Programming will help to create the application.

How can I make a program executable by double clicking? [duplicate]

This question already has answers here:
How to make an executable JAR file?
(5 answers)
Closed 8 years ago.
I wrote a JAVA program for my wife to compare coupons stacked with sales on different item sizes to save her time on her shopping-trip-planning. Now I need to put it on her computer in such a way that she can double-click something, and have the program run. I'm not finding anything good on the interwebs (like a decent step by step).
It is a simple program, one class with a nested class, and various imports of swing, awt, and text.
Since it's my wife's computer, I can make sure that she is running the appropriate JRE. Thanks in advance for any help.
You can use Launch4j application. That convert executable jar file to windows native executable application.
You can also embed JRE with it so if JRE is not installed on machine the application will run.
you can also add some other mechanism to it also like loading image, icon, etc.
I assume you are using Eclipse. In this website they given it very clearly for eclipse.
Create Executable files in eclipse
Export it to (or create a) executable Jar.
Most IDE's will do this (I think you have to dig around Eclipse a little) or take a look at Packaging Programs in JAR Files and Setting an Application's Entry Point if you want to do it by hand
Most GUI OS's will run the Jar via a double click.
You could also investigate generating a native executable wrapper, which will make the program "look" more familiar to the user, including launch4j or exe4j or Packaging a Java App for Distribution on a Mac depending on your target platform
Use NetBeans and simply 'Build' the jar file. This will produce an executable file within the 'dist' folder of your project.
Eclipse is the same however slightly more hidden.

Wrapping JRE with my JAR in one EXE file [duplicate]

This question already has answers here:
Bundling the JRE with a Java application
(2 answers)
Closed 8 years ago.
I have read many threads in stackoverflow but I didn't get the answer.
I used JSmooth and Launch4j but what I want exactly is to get a final .exe file from my JAR application and a JRE so that my windows client won't need to install any JRE (in another way: to get a portable application with its own JVM)
I found that is not possible but why? Does that need the compilation fo the jre with my application source?
I hope my question is clear, any help will be appreciated.
Zip the JRE folder and include it as a resource in your .exe file.
At run time, you'll need to extract that resource to the disk, unzip it and then invoke it using ShellExecute to run your .jar file. The size of your executable will probably be quite huge.
This is your only viable solution.. Otherwise, if it is for windows only, why not just write the whole application in C++? Is there a reason why you need your JRE with the application? Why not let the user install their own JVM?

how can i add .class files to my java project in eclipse [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How do I include .class files in my project in Eclipse? (Java)
I am using Eclipse for Java. I have a school assignment and I have to add some .class files to my project. how can i do this. and is there anything else that i have to do. I read somewhere i have to create some Interfaces. I am not sure. help me out you big guys
Right click on the project. Then go in "Properties".
Then click on "java build path".
The only way that i know to add class files is to add them as a .jar file by adding them to the "Librairies" list that you will find there.
If you do like that it will work.
To use .class files (if you have them) in a 'clean way', assemble them in a jar file (Java ARchive) and import that as a library. As soon as you do it, you get access to your classes easily.
If you want to get/see the implementation of .class files use Java Decompiler, and you can get it as a standalone GUI or as an eclipse plugin :
JD-GUI
JD-Eclipse
Enjoy :)

Categories