Could I run a java program without installing the java vitual machine on the computer?If yes how could I do it?

Recommended Answers

All 10 Replies

no.

Member Avatar for iamthwee

Yes you can, just install the java virtual machine.

that's exactly what it doesn't want to do with its machine, so for it there's no way to run Java programs.

At some point, Java source needs to become platform-native executable code. This typically requires a two-step process: the developer compiles his or her source into Java bytecode, and then a Java Virtual Machine (JVM) converts this into native code for the host platform. This latter step originally was performed by interpretation--taking each JVM instruction and converting it on the fly to one or more native instructions. Later, just-in-time (JIT) compilers converted all of a Java program from JVM bytecode to native code as the program started up.

so JVM is a must to run java Program....

no its not possible

Member Avatar for iamthwee

that's exactly what it doesn't want to do with its machine, so for it there's no way to run Java programs.

Nope, it proposed installing the java vitual machine, I proposed using the java virtual machine. :)

Could I run a java program without installing the java vitual machine on the computer?If yes how could I do it?I mean there is softwares made by java and not need a virtual machine to run.

What part of "No" did you not understand? The "N" or the "o"?

A Java program can be converted to a native executable, however this looses all of the advantages you had from using Java in the first place, and the created native programs are, usually, no where near as efficient (in any aspect) as a normal Java Program. All of this is, of course, a moot point if you are not talking about one you are creating, but rather just something you have downloaded.

and don't forget that those "native" executables are usually exewrappers which pack a JVM together with all the classes the application need into a single executable, so when installing them you're implicitly installing a JVM...

So, to reiterate what everyone else has already told you, the answer is essentially
NO.
If you need an installer that will install java for a user if they don't already have it, take a look at http://izpack.org/.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.