MySQL failed -jar .exe - java

I have a project called "agenda", designed in Java with MySQL database. Developed the application at Netbeans.
I want to launch an executable .exe from the .jar (Clean and build) with the Launch4j program. I follow the steps correctly:
giving a name to the .exe
looking for the .jar from which to generate the .exe
select an .ico image
minimum JRE 1.8
It correctly generates the .exe but when I want to launch it to test, it tells me:
MySQL failed.
I have the XAMPP open (both MySQL and Apache).

Related

Spring boot application exe file

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

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.

Deploying Java application to a Linux computer

I have developed a desktop Java application on Windows using Eclipse. It is just a console application. It uses several third party jar files and on Windows, several third party dll files are also required.
On the Windows machine, I can run the app from a command prompt as well, which I have copied from Eclipse. The command prompt references several of the third party jar files in the -classpath argument. In the development environment on Windows, all the dll files have been placed in the project home directory. The third party jar files have been included in the project Properties, "Java Build Path" setting on Eclipse.
Now, I want to move and run this app to a Linux computer for deployment. How should I do it? One way would be to use the same command line that is being used on the windows machine with modified -classpath arguments with the destination of third party jar files on the Linux machine. Is that the right approach? On the linux machine, I would also need the third party Linux native .so files. Should I just copy them to the project directory on the Linux machine? Should the project directory structure be same as the one I have on my Windows development machine?
Or should I just export (Eclipse Export) everything into a jar file and run the app using java -jar myapp command? Where should I place the third party jar files and native .so files in that case?
I have read a lot on this topic but still cant get any clarity on whats the best approach especially with third party .dll, .so and jar files involved.

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

How to create .exe wrapper to install the Java application

Can any one please suggest me that how can I create .exe wrapper to install my Java application.
Currently Iam using the following command to install my application.
"java -jar application.jar"
After googling I came to know that we can create .exe by using some third party tool which is open source.
But don't know exactly which is best for my requirement. I have only application.jar with me as an input.
Thanks In Advance.
In order to make the command double-clickable, you have two options.
The first is a bat file with exactly that string "java -jar application.jar" in it, which is double-clickable just like exe.
The second is to make an exe by compiling the following C program.
int main(){
system("java -jar application.jar");
}
I like to use 7zsd.sfx to create installers for my java applications.
Directions:
1.) install 7zsd.sfx from http://7zsfx.info/en/ and install 7z
2.) create a .7z archive
3.) add all the jre files required to run the java application to the archive
4.) add the application itself to the archive
5.) add a .bat or .exe file (for windows) to install the files after 7zsd.sfx extracts all the files
6.) add a .bat or .exe file to run the java application using the jre files
7.) create a file (preferably named "app.tag") with a structure such as that below (add your own parameters)
;!#Install#!UTF-8!
Title="My App"
BeginPrompt="Do you want to install My App?"
Progress="yes"
ExtractDialogText="Please wait while app files are being extracted..."
GUIFlags="32"
ExtractTitle="Installation"
FinishMessage="My app has been installed and added to your desktop."
RunProgram="setup.bat"
;!#InstallEnd#!
The RunProgram is the program that runs after the files are extracted to a temporary folder. This program should create a permanent folder to hold the necessary extracted files (jre, java application, and executable to run app with jre). Additionally, the program should create a nice, good-looking shortcut for the executable file used to run the app and it should move it to the desktop and add an icon.
Finally, to create the exe which will install your files, go to the command line and access the folder with 7zsd.sfx and type in the following command:
copy /b 7zSD.sfx + [pathToDirectory]\app.tag + [pathToDirectory]\yourAppArchive.7z [pathToDirectory]myExeInstaller.exe

Categories

Resources