How to run .exe file converted from .jar file using Launch4J tool without Jre - exe

I converted my jar file into .exe using Launch4J. Now as per my need I have to run this exe file on system with no JRE installed. Is it possible to run .exe file converted from jar file without JRE or is there any way to embed JRE with the .exe file?

the exe is just a facility to run the program on windows, it is also needed the JRE.
[]'s

I think you don't need JRE for running a .exe file.But if you create a .exe file from a jar file, you should have JAVA in your system or in any other PC you want to run the .exe file. So JRE comes with the JAVA when installed(only basic thing). I think you can include JRE by using launch4j. I used it long back ago. But I won't personally recommend it. I always use Jar2EXE for converting the jar file to an .exe file.

it's not possible to run the exe without JRE (since the exe is just wrapper of jar)
I would suggest you to use a setup tool to create an Installer. It's the easiest way. Launch4j is not capable of putting JRE into exe, so you would have to send 2 parts (exe + JRE). However if you create an Installer, you'll have just 1 exe file where you have packaged everything. I'd recommend Inno Setup Compiler.

I don't know with Launch4J.
But you can do it with NetBeans and a couple of tools. The result is a standalone installer that packages everything you need (included java files), so your software can run without installing JRE. But in the end it does need JRE to run, only that everything is included, and it's totally portable.
here is this solution

Related

How to auto run jar file in Linux (fedora, ubuntu) such as service on Windows

I made executable jar file for release to customers.
For Windows, I made .exe setup file.
if exe file executed, made jar file installed and auto run on service.
But, I don't know way for release linux like Windows.
I want to setup and then auto run in linux such as made for windows exe file.
Anyone know how to do this?
I found informations like packaging but, these things do not seem to be what I want.
You can create a custom RPM package which install your executable jar. You can also add steps for installing systemd unit file(init file if on older Linux system) which will run your jar as service.
These RPMs uses script which specifies what to do while installation. Just add the steps to copy jar to /bin directory and steps to create/install/enable systemd unit file onto system.

mingw64 - the file has been downloaded incorrectly

I try to install MinGW-w64, but during install i got
the file has been downloaded incorrectly
I have 64 bit win10 and my option of installation:
I use that link sourceforge. and some commentators have same problem.
Any idea how to fix it?
Newer MinGW-w64 releases are now available at https://winlibs.com/ as standalone packages that don't need an installer. Just extract to a folder and start using. This also allows having multiple versions on your side by side (e.g. 32-bit and 64-bit).
This MinGW article addresses the issue. It's actually pretty simple to fix. The problem is with the Windows installer. What you need to do is download the MinGW zip archive directly (not the installer) and extract the files to something like C:\mingw and then add it to PATH in Environment Variables. Here's direct link to the SourceForge files you'll need.

how to bind java setup with my application setup?

i am beginner in java. i have done one application using java swing. Now i want make a setup or installer of that application.
i have been trying install4j for .jar to .exe file and "inno setup compiler" for setup and it run successfully. but problem is that this setup run on machine where java is not installed but the application is not running and generate error for the java runtime environment is not installed.
how i can install java with my application on machine of the user of my system
In install4j you need to configure your installer either as static bundle or as a dynamic bundle. A static bundle will ship the JRE with the installer and the dynamic will download the JRE at installation time.
From the help page:
Static bundle
The selected JRE will be distributed in your media file.
Dynamic bundle
A dynamic bundle is downloaded on demand. If the user already has a suitable JRE installed, that JRE will be used. If there is no such JRE available on the target machine, the installer will download the dynamically bundled JRE from the URL that you specify in the text fields below.

How do I configure Oracle Java JDK 7 (not Open JDK) correctly on Ubuntu 11.10 and run a Java Program with referenced JAR files?

I may have multiple questions here, but ultimately I'm trying to compile and run a Java program that references 3rd party JAR files (on Ubuntu Linux) so I thought it was appropriate to keep it to one question.
I'm trying to get Java JDK 7 properly installed and configured to run a simple program on Ubuntu Linux. I'd like to get instructions from an expert that can help me, at the very least, to run a simple Java program from the command line (perhaps a "Hello World" application?). I've only compiled and run Java programs on Windows in the past, so this is new to me. Last night, I read that you have to be careful of not installing the Open JDK, and to install the Oracle JDK. It appears that Ubuntu 11.10 installs Java Open JDK for you when the OS is installed, among others.
I'm running 32-bit Ubuntu, not 64-bit. So I downloaded this Linux JDK file:
jdk-7u4-linux-i586.tar.gz
I unpacked the tarball into /usr/java and then deleted the *.gz file to save disk space. Some tutorials say to install into /usr/java and some say to install into /usr/lib/jvm, so I just picked one and rolled with it. If you have a suggestion on the appropriate install directory, please let me know what you suggest.
I then checked what Java version was installed (below) with the "java -version" command. It did not find the Oracle JDK.
(1) Why didn't the command list the Oracle JDK package I just installed?
mac#UBUNTU:/usr/lib$ java -version
The program 'java' can be found in the following packages:
* gcj-4.4-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install <selected package>
mac#UBUNTU:/usr/lib$
(2) Can you help me with the steps necessary to configure this Linux machine to compile a Java program (finish what I just started)?
(3) Can you help me with the steps to compile a *.java file to create the *.class file?
(4) Can you help me run the Java program--the one we just compiled?
(5) Suppose I want to include multiple *.jar files (3rd party assemblies) in my Java program. How does Java know on Linux where to find these files if they are not in the directory running the Java program referencing them? (I'm only familiar with a CLASSPATH in Windows)
Ubuntu is based on Debian and its apt-get utility. apt-get will list only known packages. The one you installed is just a folder lying on your system and apt-get does not even know about it.
It looks like java is not on your path. So either you create a symbolic link to the java binary in one of the folders of your path (type env to see what's in your path variable), or you add the JDK bin directory to your path (see command export). As a last resort, you can type the absolute path to the java binary, but that's just painful.
To compile, you simply use javac (Java compiler). For example javac Test.java. Make sure that javac is also on your path (or use the absolute path to the java compiler)
To run it, type java -cp . Test (don't forget to type the fully qualified name of your class if you put it inside a package, which is recommended)
When you compile or when you run, use the argument -cp followed by the list of jars you want to use (separated by a ':' on Linux and by a ';' on Windows). You may use wildcards in your classpath (like lib/*.jar) but you may also have to escape the wildcard to avoid shell expansion (like this lib/\*.jar).

Installing Recent Release of JDK Using Cygwin?

Can somebody tell me how to do this? Or, point me to a good link?
I want to install Jmeter but "./jmeter" tells me that:
Error: no server' JVM atC:\Program
Files\Java\jre1.6.0\bin\server\jvm.dll'.
So, I need to get the server JVM up and running.
I have been attempting to download and install the JDK from
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html
And got a corrupted file error when I tried to install:
jdk-6u25-linux-ia64-rpm.bin
Should I be doing this via wget or apt-cyg? Or, how do i determine which installation
package I should be downloading from the oracle/sun downloads page?
Thanks in advance.
You are on Windows so you should try the Windows x86 version unless there is a particular reason why you want to do that with Cygwin. Or try this:
Copy 'server' folder from the JDK's JRE's bin folder (example: C:\Program Files\Java\jdk1.6.0\jre\bin\server)
Paste the 'server' folder to JRE's bin folder (example: C:\Program Files\Java\jre1.6.0\bin)
Cygwin aims for Linux source compatibility, but it does not provide Linux binary compatibility. This means that programs have to be built specifically for Cygwin and that Linux binaries such as the linux-ia64 JVM mentioned here will not run on Cygwin.
Perhaps it is possible to build the OpenJDK JVM for Cygwin, but it doesn't ship with Cygwin. The Cygwin Ports repository contains a package for the lightweight JamVM.
But in any case, JMeter was looking for the native Windows version of the JVM, so you probably just want to install that, as Jano already suggested.

Resources