A
A
afiskon2011-07-12 04:47:56
.NET
afiskon, 2011-07-12 04:47:56

Converting JVM/.NET code to binaries?

Perhaps you want something strange (and perhaps you haven’t finished your Java mana). In general, isn't there such a thing as taking a program compiled for JVM or .NET and converting it to a binary (not necessarily windows) that can be run in an environment without a virtual machine? In fact, I want to attach a JIT compiler directly to my program. If it is possible to do this, do you know how much the size of the program increases in this case?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Zagrebelin, 2011-07-12
@afiskon

With jvm, there is nothing easier than putting the jre directory in the program folder and prescribing class_path in the launch .cmd.

S
susl, 2011-07-12
@susl

There is gcj, there are a bunch of ahead-of-time compilers. But you need to understand that you still need to carry a full-fledged runtime with jit (or, in extreme cases, an interpreter) + standard library. Jit (or interpreter) is needed because you can load classes dynamically.
A simple console application compiled by gcj with a linked runtime will weigh several tens of meters. If you don’t link the runtime to the binary, then there is no difference with the usual jvm in the principle ... and both should be separate in the system.
In addition, the last time I dug into this, java support was not complete. I don’t know how the situation is now, but I think it’s not better, given that gcj has not been updated for a couple of years.

D
Dmitry Sidorov, 2011-07-12
@Doomsday_nxt

mono has AOT . But it only works in Linux + as far as I understand, it cannot compile to .exe (even if the source file was .exe).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question