Venky
Venky

Reputation: 11107

Possibility to run desktop application in a machine that doesn't contain a JVM

I am going to create a Desktop application in Java. I don't know whether user having JAVA VIRTUAL MACHINE or not.

My questions are:

  1. I want to know whether its possible to run Java application in a machine that doesn't contains JVM.

  2. If its possible, I want to know whether this case is possible, I will created a application say MyApps, I will to convert this as .exe file and if user clicks MyApps.exe it should run my Java application and install JVM and run in that machine.

Upvotes: 2

Views: 319

Answers (4)

Venky
Venky

Reputation: 11107

Finally I got the solution for running my Java application without Java Virtual Machine, by bundling JRE in the exe file. I did this by using the following link.

It's really working awesome.

JAVA without JVM using Launch4J

If we maintain the Directory Path as given we can get .exe with JRE bundled that will run without JVM.

Upvotes: 0

user unknown
user unknown

Reputation: 36229

Use webstart, and to install java automatically, see the great comment of Andrew Thompson.

  • Then the user is free to use Solaris, Mac or Linux if he likes.
  • and updates for the JVM will be shipped to him. You don't need to rollout a new update for every bugfix in the JVM or Java-libs.

Upvotes: 3

Nico Huysamen
Nico Huysamen

Reputation: 10417

Nope, you need a JVM to run the Java bytecode. The only solution would be to transform the bytecode into a different executable format.

Upvotes: 0

Peter Lawrey
Peter Lawrey

Reputation: 533530

  1. You can run a Java application on a machine which does not have a JVM, provided you install the version of Java you need first.
  2. You can create an application which will install java as required and then run your application. However you cannot write this in Java (unless you have a JVM installed already)

This is not completely pointless as many system have some version of Java but may not have the version you need.

Upvotes: 1

Related Questions