mowwwalker
mowwwalker

Reputation: 17344

Can Java be run without a Java Virtual Machine?

Sorry for the stupid question, I'm just beginning to learn Java. Can it be compiled into a .exe to be run on another computer, or is it only for computers with a JVM?

Upvotes: 1

Views: 274

Answers (2)

corsiKa
corsiKa

Reputation: 82579

Not exactly. You can bundle a JRE with your executable, which is kind of like the same thing. Embedding a JRE is one approach offered by launch4j.

There are third party projects that will allow you to do this. A free one is http://gcc.gnu.org/java/ . I don't believe it's officially supported by Java though, but it's also gnu, who happen to know a thing or two about compilers.

There is also http://www.excelsior-usa.com/jet.html which is a paid product, but supports up to Java 6.

Upvotes: 6

Kevin
Kevin

Reputation: 3509

Can you make candy without sugar?

Yes, you need to have a JVM (just the executing for compiling) to run and to compile. Although, it is not necessary when trying to write just the code.

Upvotes: 1

Related Questions