0

I'm trying to use gcj to generate a stand alone executable. It works fine with java 1.5 that comes with gcj-4.8 when installed on Ubuntu 14.04. However if I want to use a later version of Java (such as 1.8) gcj doesn't understand the latest language libraries. I tried using -I, --classpath, and --bootclasspath to force it to use the 1.8 jdk (which is installed).

Any suggestions, or alternatives, to compile Java to a native executable?

ManoDestra
  • 6,325
  • 6
  • 26
  • 50
Larry
  • 1
  • 1
    `gcj` doesn't support any of the new language features either. The [homepage](https://gcc.gnu.org/java/) specifies that it *supports most of the 1.4 libraries plus some 1.5 additions*. – Elliott Frisch Apr 06 '16 at 14:41
  • Amended formatting of answer as well as minor edits for clarity. – ManoDestra Apr 06 '16 at 17:19

1 Answers1

1

The only alternative I can suggest is Excelsior Jet

I did not personally used it, but studied native compilation long enough to know that for me, it's the most viable solution (in 2016).

Please note that it is not free for commercial use and not open source.

[Edit] As specified by Dmitry, Excelsior Jet is actually free for non commercial use. You'll find more info here

Monsieur Max
  • 168
  • 2
  • 8