Spring boot application exe file - java

Is there any way to create the exe file of spring boot application executable jar? I've used launch maven plugin but exe file which it's creation is not working. On double click it doesn't show application Console....

You can use Launch4J:
https://genuinecoder.com/convert-java-jar-to-exe/
Download Launch4J: http://launch4j.sourceforge.net/
Select your .jar and the output for your .exe
Select additional details, for example an Icon. Most basic configs speak for themself.
Include classpaths:
Aditonally select the required java version in the JRE tab.
Build the .exe!
--
Although in your case if you just want to run the .jar I would look at my other comment first and run it with
java -jar <jar-file-name>.jar

Related

JavaFX program can not run without admin privileges after deployment

I have developed a JavaFX program that uses a derby embedded database. I am using JDK 11.0.10, IntelliJ 2020.3.1, JavaFX 14.0.1 and Gradle 6.3.
For the jar file, I use shadowJar to make a working jar file. Then, I wrap the jar file to make an .exe file using Launch4j: The executable file works fine.
My problem now is after I make an installer of my program with Inno Setup Compiler, the .exe file won't work unless I run it with admin privileges. I can wrap a Manifest with the executable to make it run as administrator every time but I was wondering where is the problem and is there any way to fix it to make the executable run normally.

Program runs in Eclipse but running jar does not run

I'm working java swing application.My program run successfully in Eclipse but when i create running jar,it's does not opened.
I created running jar like this
In my option ,problem is that I'm using 4 jar library jmrtd.jar,Scuba.jar and etc.
What am I doing wrong? How i can create jar file,when I use some support libraries(jar files) ?
Please use option "Package required libraries into generated JAR"

Can I bundle all java classes in to jar app?

I have created a project to collect the daily status in an xls sheet, using the selenium webdriver.
Currently it runs well.
Can I make this project into a standalone application or a executable jar? Or is there some other way to collect the status by clicking on the application or jar to open it without having to compile and run from eclipse?
You can use install4j from below mention URL. It will make executable jar and application.exe also you can make installer for different platforms such as Mac, Windows and Linux.
https://www.ej-technologies.com/products/install4j/overview.html
hope it will help
From Eclipse select Export -> Runnable JAR File
Select 'Extract required libraries into generated JAR'
When you have your JAR file execute :
java -jar MyJar.jar

Adding additional files to an Inno based setup for a Netbeans application

I am using Inno 5 Setup Installer in Netbeans to build my Java Swing application into an executable set up file. It creates an app.exe setup file with all the lib(all jar file) and app.jar.
So once user executes app.exe file, it create a folder at C:\users\username\local\appname which has the app.jar file and the libraries.
Is it possible to add additional text files in app.exe setup? so these text files will also be avaliable in "appname" folder when executed. These are required for the app to run.
Thanks for your time :)
In Inno Setup there is a ScriptWizard which i recommend to use. After a few steps there comes this window:
NOTE: I use the application from Inno Setup. I got the Screenshot from there.
If you click on "Add files" you now can select your text file and it will be setup within your path.
If you don't want to use the wizard, you can add your additional files as entries in the [Files] section, like for instance:
[Files]
Source: "C:\path\to\your\text\file\you\want\to\add\to"; DestDir: "{app}"
Except listing one entry per file, you can add e.g. all files of a certain extension from a given directory.
When you right click your project in NetBeans then Package as -> Exe installer, then NetBeans does several things:
bundels your app in an exe and adds JRE files
creates an Inno script for you
executes the inno script and create the installer
This is nice but, if you need to change stuff like add more files, app name, vendor, version, install location, icons, etc... you need to edit the .iss file. But...where is that .iss file NetBeans creates?? -> check below for answer
The cleanest way to have an installer, and a native executable for your Java app developed in NetBeans is the following:
check the instructions here, to enable native packaging https://netbeans.org/kb/docs/java/native_pkg.html
Build your app
Right click on NetBeans project -> Package as->Exe installer. This step is to obtain the .iss setup file produced by NetBeans. You can use it as starting point.
The .iss file is generated at C:\Users\YOUR_USER_NAME\AppData\Local\Temp\fxbundler[somenumbers]\images\win-exe.image\YOUR_PROJECT_NAME.iss
build and clean the project again
Right click on NetBeans project -> Package as-> Image only. This will wrap your app in an .exe and will add JRE files needed to run the app.
The exe and dependencies will be generated in dist\bundles
Add more files in the app folder based on your needs
take the above YOUR_PROJECT_NAME.iss script, along with your files from dist\bundles, adapt YOUR_PROJECT_NAME.iss script based on your needs and generate your installer for your java wrapped in a native executable.
Good luck!

Wrap the application to create sh file in Ubuntu Linux

I have created one java application which takes number of external jar files and also VM arguments passed to it.
I want to create .sh file for that application so that I cat run it on any linux system.
Please suggest me any tool to create .sh file in linux and which will also takes care about the arguments which has to be pass to application to run it.
I have use the tool named JarSplice but its not working as there is problem in loading libraries after creation of sh file .
So please suggest any tool for that.
If you're using maven to build your application there is a plugin called appassembler-maven-plugin that can create a .sh file for your application.
The groupId is org.codehaus.mojo.
You need to generate an executable jar, then you can simply run "java -jar main.jar" from there.
There are many questions on stackoverflow on how to create executable jars (you need ot set stuff in the MANIFEST.MF file in the jar file), for instance:
How do I create executable Java program?

Categories

Resources