Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java application and MySQL installation in a single package

Tags:

java

packaging

How can I pack a Java application and MySQL installation files in a single exe file? Can I install the MySQL files automatically in background (or without any inputs from user)? This is just to simplify the installation procedure.

like image 768
Saneesh A T Avatar asked Oct 11 '11 19:10

Saneesh A T


People also ask

What are the prerequisites for installing MySQL?

Installation Requirements MySQL Installer requires Microsoft . NET Framework 4.5. 2 or later. If this version is not installed on the host computer, you can download it by visiting the Microsoft website.

How do I install MSI installer for MySQL?

The simplest and recommended method is to download MySQL Installer for Windows from https://dev.mysql.com/downloads/installer/ and execute it. Select mysql-installer-web-community-8.0. 23. msi if you have good internet connection, otherwise choose mysql-installer-community-8.0.

Which database is used in Java?

Java DB. Java DB is Oracle's supported distribution of the open source Apache Derby database. Its ease of use, standards compliance, full feature set, and small footprint make it the ideal database for Java developers. Java DB is written in the Java programming language, providing "write once, run anywhere" portability ...


2 Answers

Java is cross platform, MySQL isn't, so you'd have to create various installers for multiple platforms with different MySQL binaries. If you want to include MySQL source code for non Windows systems, then that's another story... so I assume you want just an installation for Windows.

First of all, get an installation software that you'll feel comfortable with. There is a nice list of free and non free installers on Wikipedia.

Second thing, you can do a silent MySQL installation. How it's done is explained here.

But note that doing a silent MySQL installation without user's permission doesn't sound too good to me, since MySQL isn't exactly lightweight software and you might mess up something if a user already has MySQL somewhere installed.

So, by doing this, you have to be extra careful to check if port 3306 is already up and running (default MySQL port), and other sanity checks to see if there's a possibility of another instance lurking in the background.

It would be better if you at least informed your user that MySQL will be installed. Think about these details, because they might be dealbreakers so some of your users.

like image 95
darioo Avatar answered Sep 29 '22 08:09

darioo


Use Java Web Start to launch the application.

JWS offers an ExtensionInstallerService that can be used for installing MySQL. Here is a small demo. of the ExtensionInstallerService.

like image 37
Andrew Thompson Avatar answered Sep 29 '22 10:09

Andrew Thompson