I am using netbeans to create a project, and the final result needs to be an installer, that when you install the app, it would automatically turn itself on after every computer reset.
I was looking (still am) for any software that would help me, but cant find anything.. I found a simple install creator and it makes an installer but it doesnt automatically puts the app as a windows service (i could use the CMD to make it as a service after the installation, but i want it to be automatic).
Another alternative is that the installer would put the application exe in the users startup group, but again, i want it to do so automatically.
Can someone recommend me some simple software for this.
Thank you.
Try Install4J. Although it is not free.
install4j offers full support for generating and installing services (daemons). For services, install4j generates service executables on Windows, startup items on Mac OS X and start/stop scripts on Unix/Linux platforms.
I don't think this is a right SO question.
Any how, have a Look at WhatInStartup
(it's free)
Create a exe Jar file of your program, add just add to it.
To do it in a easy way,Look at Jar2Exe
We have used Java Service Wrapper at my job, and it has worked fine for years. It is not free though.
Related
I have a Java program I made using Eclipse IDE. I can export it as a JAR file, and after manually installing the JRE on other computers, I can run it there.
I am now looking for something similar to ClickOnce in Visual Studio, where you can specify the .NET frameworks needed by your application, and just publish your program to a server. The application would then be downloaded from a webpage, automatically manage program versions, and let users know when a new update is available.
I found that Java Web Start was used for something like this, but it has been deprecated and continued as Open Web Start (https://openwebstart.com/). Is this something that can be integrated in Eclipse? What else could I use for distributing and deploying my program?
Thanks,
I read SO q&a about launch java as windows service wrappers, but can't find/choose product, suitable for my requirements :
Wrapper reads all java launch parameters from config file. In registry must be only commands to run wrapper itself - path to exe and maybe path to config. Always grant admin rights to change app parameters in registry is not comfortable.
Working dir and path to application also must be in config. I want to place all wrapper files deep into program, because user not intrested in it.
No dependencies(.net, python, etc). I don't want to extend requirements of my program.
Free for every windows OS, include win64.
Simple and lightweight. Size of my program with all 3rd party jars is 12Mbytes. I don't want to add 20Mbytes wrapper.
Automaticaly restart if app process dies.
Preferably single exe files for all windows platform.
I try and lookinkg throught different wrappers and tired a bit. Best suitable till now is:
jslwin (http://jslwin.sourceforge.net), but i don't know how mature it is(version 0.99). Also parameter lists in config is a bit complex(need to edit parameters quantity).
winrun4j (http://winrun4j.sourceforge.net), but i don't know how mature it is(version 0.45). Also it needs a special class for working as a service.
Also i try or look throught:
YAJWS (http://yajsw.sourceforge.net/) too big (30mb), can't make it work with custom files layout.
Advanced Installer (http://www.advancedinstaller.com) too big (50mb).
nssm (http://nssm.cc/) store launch parameters in registry(no config)
winsw (https://kenai.com/projects/winsw) .net required, stops after process dies
commons-daemon, procrun (http://commons.apache.org/proper/commons-daemon/index.html) store launch parameters in registry(no config), can't understand this product, i think it's complex.
jsmooth (http://jsmooth.sourceforge.net) complex and old(last update 2007)
javaservice (http://forge.ow2.org/projects/javaservice/) old (last update 2006)
runasservice (http://runasservice.sourceforge.net/) requires .net
windows rktools - sc, instsrv, srvany (http://support.microsoft.com/?scid=kb%3Ben-us%3B137890&x=16&y=7) - store launch parameters in registry(no config)
jwrapper (http://www.jwrapper.com/) seems not what i need. It packs java program in exe file with JRE. It's not about windows services.
firedaemon (http://www.firedaemon.com/) not free. And maybe it's not what i need.
launch4j (http://launch4j.sourceforge.net/) cool ability "search or download java". Maybe i add something like this to simplify installation, but it is still not about subj.
Java service wrapper (http://wrapper.tanukisoftware.com/) not free for win64.
Tell me please which wrappers suits my needs? Or maybe i think wrong about wrappers above and some of them suits my needs to?
I have had similar issues over the years. Its not that they all are inferior, its that they are all pretty hard to integrate nicely with your own project.
You may want to check out stork: https://github.com/fizzed/stork
It'll help create launchers for your Java console or daemon apps, and they will work across all major platforms. There is also a maven plugin in case you wanted to tie it into your existing build process.
I'm not sure if JWrapper will fulfil all the requirements like 1 and 2 in the way that you want it since rather than you dictating how it does the launch and where it puts things etc JWrapper instead handles that stuff in its own way but it does produce executables for win/mac/linux and more importantly it does support windows service installation as well as macos and linux daemon installation:
http://www.jwrapper.com/guide-installing-a-service.html
The service support though is for paid licenses, the free version doesn't currently support it.
Disclosure: I work for JWrapper
I have a java system tray application that runs on both windows and mc osx.
I want to add my app to start up programs for both od those os-
which is best:
Check in code which os i'm on and then do a certain action accordingly?
Create a different installer for each os that will add the program to start up?
Also, is there any good example on the best Generic way adding program to windows(for all windows types??) by code or by install, and also a good example for creating a launch agent for the mac?
Thanks
Lior
Update
Initially i would go for #1, as it easier to manage other than managing installation packages for long. but on the other hand, it is not generic, and id like to keep my code generic as possible. And third, i'm on a very short schedule, if there is a 3rd party installers that can warp this up and create different os installer with start up, thats better, under the circumstance of course.
Since you are doing a multi platform Java application I advise you to follow it's 'Write once - run everywhere' rule and either create an self-executable jar file (both Mac and Windows are capable of running those, e.g. explained here) or you could try an out-of-the-box solution like IzPack
For #1: Check the system property os.name on a win 7 box you will get Windows 7. You can query system properties with
System.getProperty("os.name");
I have a Java application with a web-based UI (using Vaadin framework).
I want users to get the app and run on their local machines. Some users can be not very technical, so need to make this as simple and foolproof as possible for them.
Possible solutions:
Create a distributive with the webapp + Jetty + batch and shell scripts to start the app.
maybe include JRE too.
The User Story will be: download some ZIP file, unpack and run "start.bat" or "start.sh". The script will start Jetty and maybe launch a web browser with "http://localhost:8080/myapp" URL. There should be no magic with "installing JRE" or "what's your Java Home" or "Your JRE is too old", etc... This would scare the hell out of many non-technical people.
Difficulties here: what if the machine does not have JRE? I'd like to avoid creating 3 different distributives with JREs (for Win/Linux/MacOS). Packaging all 3 JREs into the same distributive seems like an overkill.
Another approach I see is using Java Web Start. My app would be downloaded through JWS with Jetty JAR as a dependency and start the embedded Jetty in this case.
The User Story: click a button on some website to launch the app locally.
I remember having problems with using JWS from behind a proxy ~5 years ago: the dependencies could not be loaded. Not sure if it's still a problem. I haven't used JWS since then, so I'm very familiar with it.
Another problem with JWS is that it will require people to have internet connection to launch the app (at least for the 1st time or maybe every time), which is not always possible (some organizations can't be connected to the Internet). AFAIK, the last JWS suggests installing JRE if it's not there yet, so this should be easy for end-users.
That's probably it for the potential issues with JWS (?).
Finally, the last approach is to pack everything with something like launch4j or InstallShield or whatever. Hopefully those programs are capable of installing JRE is it's not present yet and also can run in headless mode (for servers).
So far option 2 looks the easiest for most users, assuming that JWS can do what I need.
So, my questions are these:
Which additional pitfalls do you see with these 3 solutions?
Which one would you prefer in my case?
I prefer a combination of the solutions 1 and 3. I mean:
First, build a jar with an embedded Jetty that runs your webapp. This jar must have a main class (that starts an embedded Jetty) and a MANIFEST.MF configured with the "Main-Class" property, so this jar can be runned with: "java -jar myEmbeddedWebApp.jar".
Then, use launch4j to build an exe wrapper for that jar, eg myEmbeddedWebApp.exe
I have written a very simple Java application. Can anyone tell me how to create a launcher like icon to run that application both in Ubuntu and Windows ??
Thanks in advance..!!
An executable JAR should work fine for a launcher on both Windows and Linux. However, that won't get you a custom icon.
On Windows, you can use JSmooth, which will create a .exe wrapper around your JAR file. The JSmooth program will let you create an icon for the EXE as well (it also has options such as getting the user to download the necessary version of the JVM, or only permitting one instance of the program to run).
If your java application is to be distributed from a web server, you should have a look at Java Web Start which can do what you ask for based on a JNLP-file. Notably see
http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/javaws/developersguide/faq.html#104
Ubuntu and Windows will both have different ways to launch the application. I see two routes to follow here. One is to use Java Web Start and use a web interface to start your application. The other is to search for some sort of 3rd party installer that will create setup/installation programs for all the platforms you want to use.
I actually used a third party install program before, InstallAnywhere, but it was almost ten years ago. It offered the functionality you are looking for, though.
There are different ways to do this, sometimes the simplest is the best approach. One solution as suggested is a simple starting script. Roll your application into a jar, then include a script that does nothing more than "java -jar myscript.jar". I do this all the time for internal customers that may be running various types of *nix and whatever version of windows (a few macs as well). How sophisticated you need it to be depends on the audience served.
Create a bat/shell script which starts your application.
And than create a shortcut/launcher for it.
Shortcut file in windows has extension lnk.
Update
See example - SQuirreL launch file.