If I am understanding correctly:
It will allow me to send an embedded JRE along with my JAR so that my jar works whether or not the user has Java installed on their computers.
I have never worked with it before so I thought I might ask before going on a steep learning curve :)
Launch4j does not embed the JRE. It is a wrapper for your JAR file which checks for an appropriate JRE installed on the target PC, and if it is not installed it will offer the user to download it.
Related
OK, I’m still a little overwhelmed by all the choices for deploying an application. My case is really simple. I have a Java program that’s now working in NetBeans on Win7. I want to run it on another Windows desktop that doesn’t have NetBeans.
The method presented here: https://netbeans.org/kb/docs/java/native_pkg.html produces a single .exe file that installs the application on the Win desktop. But, that file is huge because it includes all required portions of the JRE.
The method presented here https://netbeans.org/kb/articles/javase-deploy.html uses the JRE already installed on the Win desktop so the distribution is very small. But, it requires you to distribute both a .jar file and a lib folder.
So, finally, the question. Is there a method that uses the already installed JRE and only requires the distribution of one (small) file?
Thanks.
Since that second option has everything you need to run the app (provided that a JRE is available), you can use that with a third party install packager like izpack
I just wonder if I use launch4j to convert jar to executable (exe file) on Windows. If I take the executable (and other created files if there is any) to another computer which doesn't have JRE installed and I don't have administrative permission, will the executable file still work? Many thanks!
-updated from here-
I didn't try launch4j yet and from reading doc I didn't quite understand really and I didn't think I get my answers. Reading english literature is very different from reading a technique doc. I have a very limited IT knowledge.
I did do a bit search here. I found someone says launch4j is just a wrapper and still need jre installed in the end user's computer, but the the post was 4 years old. So after some research I'm still not 100% sure if I need install jre in the destination computer. For me if jre is an absolute need in the destination computer, then I can forget about using launch4j as I know I won't get jre installed there. However I got a feeling launch4j maybe can somehow bundle jre with the exe file and the exe file can then be run on any computer without jre installed. I'm just trying to confirm things I'm unsure about.
So the answer I'm looking for is
1) yes still need jre installed, then I can't use launch4j
2) no you don't need jre installed, then I will learn how to use launch4j
3) depends, then I will probably give a try
However, I don't think I should be punished by being marked down because my lack of background knowledge. Although the original post does look like some random post. Thanks.
So for beginners and people who don't have an IT background like me, here's the definite answer for my own question.
"Hi guys.
I just wonder if I use launch4j to convert jar to executable (exe file) on Windows. If I take the executable (and other created files if there is any) to another computer which doesn't have JRE installed and I don't have administrative permission, will the executable file still work? Many thanks!"
"Hi,
The JRE is still required, the executable will not work without it. However, you can bundle the JRE with your application so even if the user does not have Java installed it is possible to run the app.
Best regards,
Grzegorz"
"Thanks Grzegorz!
And just a small question if you could briefly explain. I noticed you used the word "posssible", does that mean there are some cases you still can't run it?
I will try it out anyway cheers!
Joe"
"No, there are no special cases here, if you bundle the JRE it will work.
Cheers"
original post is here at this Link
Cheers!
this is a kind of weird non programming (but java related) question.
I created a java program (game) using just normal java, and no libraries.
In ordor to double click/open it, you need to have java SDK/JDK (I don't know which) installed.
I tested this multiple times, and in order for my PC and Mac to launch it, you need to install it.
is there anyway to get around this? I know Minecraft doesn't force you to download the JDK.
Here's the link to source code of my game if your interested (no, it is not a virus): http://www.filedropper.com/daplatform
Thanks, Jake
Here's the link to the download of the JDK (Its next to the giant Netbeans download): http://www.oracle.com/technetwork/java/javase/downloads/index.html
What you can do is you can wrap both your program and the JRE required to run it into a single executable for the target platform.
For example your windows installer would include both a windows JRE and your program itself.
Launch4j http://launch4j.sourceforge.net/ lets you wrap a Java program into a windows executable and gives you options about how to handle the JRE, including bundling it.
I made java application's setup file through install4j and it is well known that netbeans application does not run without jre. so my question is that is there any way to install jre automatically if it is not installed previously before installing application.I heard that there is way to create .dll or .bat file for that but i dont know exact about that.So please help me as soon as possible.
Thanks and Regards,
Mahesh
http://www.ikvm.net/
This might be a good route to go, i'm looking into it now. In short it pushes your jar to run on a .net build
I've got a Java application that I'm writing an installer for. We're using the AdvancedInstaller program to create our installer (well, we're evaluating it currently, but will definitely purchase a license soon), and although it has special support for Java applications, it is geared more towards repackaging them as desktop-type apps, and our software is a series of Java services and other utilities which doesn't make sense to distribute in EXE-wrappers. The target audience for this software is very specific, and we know that our software will probably be automatically distributed on freshly-imaged Windows 2003 Server machines. So requiring Java as a prerequisite basically makes more work for some poor sysadmin, and I'd rather avoid that if at all possible by repackaging the JRE's installer inside of our own.
I discovered that if I tried to execute the JRE's installer as a pre-install step from my MSI, it complains that another installer is already running (mine, of course), so it bails out. When I try to add the JRE installer as a software prerequisite in the AdvancedInstaller project (as a bundled EXE, not a URL link), it never seems to actually get installed, despite me trying to force-install it.
What's the best way to repackage the JRE? I'm not really a Java guy, so I don't know too much about how other developers deal with this same problem, short of requiring their users to hunt out and install the JRE on their own. The ideal solution here would be for us to find a EXE installer which can be executed from inside of another MSI installer, or if it's possible, to just package all of the files inside of the JRE and then create the appropriate registry and environment variables. How should I go about doing this?
I have not idea if this is "the way" to do it, but confronted with a somewhat similar problem, we simply archive an installed JRE with the rest of our application files and make sure that all our start scripts don't use java ..., but rather ..\..\jre\bin\java ... or similar. The JRE is unpackaged as part of our installation process in a subdirectory of where we install and that's that.
I agree with bdumitriu's answer:
a simple zip of a jre is enough, unless you want to link that jre to:
default java (meaning you must add java.exe of the unzipped jre to the path, before any other java path references)
default java for some script (you could define JAVA_HOME as referencing your new unzipped jre, but that may have side effects on other script also using JAVA_HOME before that new JRE)
file associations like .jnlp or .jar files (this requires some registry modifications)
browser java plugin registration (which requires also registry modifications)
If the last two points do not interest you on the desktop concerned by this deplyment, a simple zip is enough.
http://www.syswow64.co.uk/2013/05/java-7-update-21-1721-enterprise.html
The issue on many blogs and articles is around creating the 'deployment.config' and 'deployment.properties' files for an enterprise deployment. In my case i wanted to set the security level to 'Medium', but everytime I open the Java control panel it was set to the default HIGH setting.