2

How can I compile a Java program by GCJ compiler in NetBeans? Is there any plugin for it?

ehsun7b
  • 4,796
  • 14
  • 59
  • 98

1 Answers1

4

GCJ is junk, ditch it. You can't compile all but the most primitive Java code using it.

And you can't integrate it in Netbeans, as Netbeans requires a full JDK and GCJ isn't a JDK at all.

jwenting
  • 5,505
  • 2
  • 25
  • 30
  • Could you provide evidence, that gcj is indeed junk. How comes it is possible to compile things like ecj which gcj? It is certainly true, that gcj does not provide a certified JDK 1.6, but it is definitely an implementation of Java the language. And that might still be usefull for anybody who is not interested in finding more pointless applications of reflection. – jmg Mar 07 '11 at 08:18
  • @jmg: Eclipse is one of the very few modern, big projects that gcj can run and that's because it was specifically coded in that direction (and because it didn't need a AWT/Swing implementation to run Eclipse). But the class library of gcj is quite lacking in a lot of areas. – Joachim Sauer Mar 07 '11 at 09:02
  • I'd not be as harsh as to say gcj is junk per se, but you can save yourself a lot of trouble by simply installing Sun JDK or OpenJDK. (From my experience, many programs don't run at all with gcj, and if they do, they slow to a crawl, have issues with graphics etc.) – Axel Mar 07 '11 at 10:13
  • GCJ isn't Java, it doesn't support the core class libraries, etc. etc. Eclipse can run on it maybe (never tried, don't bother) if it contains its own implementations of pretty much the entire core libraries built in (which wouldn't surprise me as it comes with its own Java runtime and compiler built in and can be installed on computers with no JVM installed, including ones without GCJ).] – jwenting Mar 07 '11 at 10:25
  • 2
    @Joachim Sauer: I think it is important to be clear about what you are talking. I was talking about Java - the language - and not about Java - the platform. Nobody in his right mind would claim Microsoft's C++ compiler is not a C++ compiler because it does not come with the KDE libraries, or boost, or Qt, or whatever, which are so often used on Linux. In order to avoid such confusion I usually say Java when talking about the language and I say JDK when talking about the platform. – jmg Mar 08 '11 at 07:55
  • @jmg: comparing the Java library with boost or the KDE libraries or Qt is misleading. The Java library is an essential part of the Java platform and the Java language without that library is severely crippled (try writing Java code for the Java ME platform, which has only a very limited subset of the Java SE libraries and you'll see). Implementing the Java language is trivial, having a full Java library to support it is far less trivial, but very important. – Joachim Sauer Mar 08 '11 at 07:58
  • Also: talking about the JDK when you mean the platform is misleading as well. The JDK is one product by Oracle that implements the Java SE platform and the development tools needed. – Joachim Sauer Mar 08 '11 at 07:59
  • @Joachimg Sauer: No, the language Java requires only the classes in `java.lang` everything else belongs to the platform. And I don't doubt the value of having a standardized platform. JDK is not the name of one Java Platform, e.g. IBM calls its Java platforms JDK as well. – jmg Mar 08 '11 at 08:01
  • @All_of_you: I know all the comparing factors about Java language and the platform, and I think you are talking about a pointless thing... All java apps are compiled and then interpreted in JVM, I asked if is there any way to compile the Java code to native code which seems to be a pointless job from the main Java prespective, BUT I'm in a situation which I need to do, is there any compiler which can convert the a complete Java Desktop app with database connectivities to a machine code??? – ehsun7b Mar 08 '11 at 10:00