0

is there a way to execute a jar on different OS (linux/windows) that could be not installed jvm on?

I take a look on lunch4j but it make a search of jre on OS. This isn't my case.

Tnx alot

Maforast
  • 257
  • 1
  • 6
  • 17
  • Why can't the JVM be installed on this different OS? JVM can run on Linux or Windows (or wherever). – Scott Shipp Apr 09 '14 at 15:09
  • 1
    Firstly the JVM can be on all those platforms no problem, secondly java doesn't run without a JVM. – takendarkk Apr 09 '14 at 15:10
  • No I didn't say that I would say that some people may not wont to install java on their os. In this case i would like to embed a JVM on application standalone? Do you understand? – Maforast Apr 10 '14 at 07:19
  • User Don't want install nothing on his machine so, I have to ambed a jvm in application jar folder. In this way I can lunch my jar without any installation by user. Can any one hel me in this issue? – Maforast Apr 10 '14 at 12:42

1 Answers1

0

1. Check following Stack Overflow answers (and its many duplicate links) Compiling a java program into an executable. You should find suitable tools that will allow you to create an easy to deploy form of your application, e.g. *.exe for Windows with all the necessary run-time libraries optionally included.

2. For inspiration of how such deployment might work (either run through the web browser click or easy to download/run installer) check yWorks yED. If you like their way you may send them an "share your know how" e-mail

Community
  • 1
  • 1
xmojmr
  • 8,073
  • 5
  • 31
  • 54
  • I need to know a way to make a java program standalone a unique package that include JVM insight. A hipotetic user that don't have JVM installed on his system, must be execute my standalone program. HOW I DO THAT? – Maforast Jun 12 '14 at 09:50
  • One way mentioned in the 1st linked article is using the http://www.advancedinstaller.com/java.html – xmojmr Jun 12 '14 at 10:05
  • It generate an istallation for windows and MAc OS not for LINUX. Also, this is an istallation, but I would like a simple click on my package (.exe or other) and not proceed to install a .msi – Maforast Jun 12 '14 at 12:55
  • 1
    I'm training with jwrapper it seem to accomplish issue (I hope). Tnx for your link I'll try it soon! – Maforast Jun 13 '14 at 07:17
  • If I will not use a program to do this job, Is there a way to include a jre distribution in a folder and make a batch that export var enviroment for linux/windows to point jre my subfolder and after make a java -jar XXXX.jar? – Maforast Jun 13 '14 at 08:19
  • yes, the 1st thing you will need is a **"portable JVM"**. Some Java Virtual Machine that does not need to be "installed". Use the words for your Google search and you should find more pointers. e.g. http://portableapps.com/apps/utilities/java_portable comes out among the first hints. You will need to use different JVM and different "batch" file format for each target OS platform – xmojmr Jun 13 '14 at 09:34
  • tnx too much i follow this way! – Maforast Jun 13 '14 at 12:14
  • I found jre for linux windows and macOS but it's very big size about 100Mb everyone. Is there more light version? – Maforast Jun 13 '14 at 14:59
  • Unpacked Java Standard Edition is quite big. That is why some installers (mentioned above) download and install the JVM only when necessary. End user clicks on native binary which does the rest. There is a standardized Java version with smaller footprint but less features known as Java Micro Edition (see e.g. [Oracle's version](http://www.oracle.com/technetwork/java/embedded/overview/javame/index.html)), used to be the built-in part of all mobile devices. See also [some Wikipedia list of choices](http://en.wikipedia.org/wiki/Comparison_of_Java_virtual_machines) – xmojmr Jun 13 '14 at 16:14