Can you have Java compiled straight into machine code?
I want to do this so I have control over what platforms it's used on, and don't know C,C++ etc.
Can you have Java compiled straight into machine code? I want to do this so I have control over what platforms it's used on, and don't know C,C++ etc. |
||||
|
It appears that the GNU Compiler for Java can convert Java source code into either Java bytecode or machine code. It can also convert existing Java bytecode into machine code. However, the last news is from 2009, so I'm not sure how current it is and if it can handle the latest features of the Java language. |
|||||||||||||
|
It might be better to detect the operating system using System.getProperty(“os.name”). That would let you choose to support more than one OS, but exclude others. |
|||||||||
|
Not quite directly answering the OP, but an perhaps an interesting aside. Java can be run in three modes:
|
|||||
|