Create Installer for Java Application Which run as Windows Service - java

I have requirement to create installer for java application. The application should serve as Native Windows Service.
I have seen following projects which can be used to execute Java Application as Windows Service.
Java Service Wrapper
YAJSW ....
Issue:
As i have to deploy the service on more than 20 systems (Can be increased with passage of time). So i think i would be good enough to create installer and distribute the installer file.
So how i can create installer file for java application which run as Windows Service ?

This is an example, using the built-in support for Java from Advanced Installer.
Advanced Installer will generate at the end an MSI that will install your application, a wrapper EXE that can also run and install as a Win32 service. Along that it contains many other options that could be handy, like an automatic updater, etc...

Related

How to create a macOS App Installer with Prerequisites

I'm developing a macOS app written in Swift which will not be distributed via the App Store.
I'm looking to create an installer which will install some prerequisites, more exactly install Java on the machine.
Are there any tools available that can create such an installer for an app?
You could get use of .pkg installator, just put java inside this package and call needed setup actions in pre-install bash script. Or even use script to install brew and call brew to install java, whatever.
There is a GUI tool to make pkg-s called Packages, it works fine and it is free. There is also some documentation on their web site.
You can also create package of any complexity using only built-in, Apple-provided console tools.

Installing jre locally in windows app directory

I have a question about deploying windows application with java module.
I have windows application with several modules. One of these modules is written in java and is packaged as jar-archive. And if there's need for using this module, the application ask jre to start execute this jar.
For this time during application installation it's initialized jre installation.
I would like to understand the following.
Is it possible to install during application installation silently install jre in the application directory. So it jre copy could be used by the application.
I'm talking about structure like this:
/app
/app/jre
/app/modules/myModule.jar
So if it's needed to run myModule.jar I could do it with java from app/jre/bin ?
I saw something like that at Spark messenger (http://www.igniterealtime.org/projects/spark/). This application uses its own jre, which is installed at /Spark/jre/. But as I understand, this application is written in java and builded as a windows distributive using install4j.
I tried to find the answer to my question, but maybe I'm doing something wrong, I always find a solution of creating an exe-wrapper for jar file.
I would like to know about possibility to deploy application with installing jre locally in application folder.
You could ideally have used Java Web Start in the past.
Currently, you can use javapackager.
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html
The javapackager command allows developers to create standalone native install bundles that do not require a separate JRE installation. The native options include: installer, image, exe, msi, dmg, rpm, and deb.
This is ideal for desktop applications, where the user may not have their own JRE installed and just wants the program to run. It may not be appropriate for server-based applications where an administrator would want full control over the environment.
https://blogs.oracle.com/java-platform-group/entry/java_web_start_in_or
In your /app/jre/bin folder there should be an executable binary called java. So in your folder /app/modules you can run
/app/jre/bin/java -jar myModule.jar
That should work.

How to package MySQL with the Install4j does Install4j has the facility of creating Installers that can also install MYSQL

Does Install4J has the feature of installing MySQL 5.0 and the database i have created ,for my Java Application on windows which is developed in Netbeans IDE
Utimately what i need is an .exe of my Java Application which is in Netbeans IDE and Installer that installs my Application into the clients system and the database created in MySQl .
Please Help with this
You could do this as part of a custom script to be run as part of your install but most likely you'd have to tailor it to each target environment. It would probably be a bit messy though as the installation process would vary wildly from Windows, to OSX, to Linux (and different Linux distros). Also, you'd have to deal with overwriting existing installations.
If you're code is database agnostic consider using something like http://www.h2database.com/html/main.html. It's pure Java (nothing to install besides adding JARs to your app), runs both in memory and persistent to disk, and feature rich. It would be much easier to deploy as you could have it save the database data in your apps install directory.
Add the MySQL installer on Files->Distribution Tree and run it with a "Run executable" action after the "Install Files" action has run.
Probably there's an argument for running that installer in quiet mode and to modify parameters of the MySQL installation.

How to create exe file of javafx application

I have created a desktop application using javafx. It uses the database of mysql. And by using Netbeans I packaged the application into running jar.
Now I want to distribute the application as a exe file for the windows users. Now my problem is how to create exe file from the jar and how that exe will connect with the database.
There is an official Java Packager Tool which is part of the JavaFX suite. It can create self-contained applications including a native launcher: .exe on Windows, .app bundle on OS X, etc. By default it bundles a JRE as part of the application, but this behavior can be changed to use the system JRE instead if desired.
You can call the Java packager via Ant tasks, the javapackager command line tool, or using the NetBeans IDE. See the Java deployment guide for details.
exe4j or install4j may be a good option
Disclaimer: I work for Excelsior.
We've just discovered that Excelsior JET seems to already support JavaFX 2. You can compile your JavaFX app down to native code with it, as opposed to (launch|exe|install)4j that are only capable of creating EXE launchers and wrappers.
That said, a launcher/wrapper generator may be a better fit for your needs and budget.

How to create an installation file server

I have a server java project, which runs on glassfish.
How does it put into the package and run on any machine and install it?
Glassfish is a heavy server. If you wants to deploy your application on several machines, you should use a lighter Java server.
You can look at theses project, which provide a package with an embedded Jetty web server (with startup scripts for all plarforms: Windows, Linux, Mac, Solaris, etc.).
http://jenkins-ci.org/
http://www.sonarsource.org/
http://nexus.sonatype.org/
Once your application can work on an embedded Jetty server, create an installer will be much easier (with InnoSetup, IzPack, etc.).
Making Multiplateform installer with Izpack is really easy and fun. You can package your application in installer and run on any machine. Just go through the tutorial here and you will have your own installer.

Categories