LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   GCJ, the java compiler (https://www.linuxquestions.org/questions/programming-9/gcj-the-java-compiler-454055/)

daziplqa 06-12-2006 12:03 PM

GCJ, the java compiler
 
hi,
can i use gcj instead of java compilers from http://java.sun.com version 1.5.
please provide me with more info as you can

Mega Man X 06-12-2006 12:14 PM

Quote:

Originally Posted by daziplqa
hi,
can i use gcj instead of java compilers from http://java.sun.com version 1.5.
please provide me with more info as you can

As far as I know, gcj does not fully support Java 1.5. It also has little to no support for AWT and Swing classes. Check the FAQ for more info:

http://gcc.gnu.org/java/faq.html#2_4

it pretty much depends what you want to do. For my current needs, gcj is a toy...

reddazz 06-12-2006 01:40 PM

Many apps don't work properly with gcj. I have nothing but grief when trying to use gcj with the likes of LimeWire and Azureus.

elyk1212 06-12-2006 01:43 PM

Yeah, ditto. The GCJ will compile to native, but you cannot use much of the GUI aspects of Java. The exception is, you may use SWT, which relies on native GUI libraries on the system it will be used on.

I don't think I would want to use it for serious projects yet, it seems a little chaotic.

daziplqa 06-15-2006 04:46 PM

Mr elyk1212: what is SWT ?
and thanx Alllllllll.

Mega Man X 06-15-2006 05:19 PM

SWT: The Standard Widget Toolkit

http://www.eclipse.org/swt/

elyk1212 06-16-2006 12:42 PM

Oh, yes sorry, I did not have a chance to respond yesterday. Ditto to what Mega Man X said. Also, please check out JFace, I think it may tie together with SWT, but I am uncertain as to the specifics.

boredandblogging 06-16-2006 01:58 PM

Is there are a reason not to use the JDK? I know its not exactly open source, but its free and works.

mrcheeks 06-16-2006 04:25 PM

To avoid any troubles use sun jdk, ibm jdk or blackdown jdk. Other projects are far from complete so you can expect anything...

geletine 06-17-2006 10:17 AM

gcj hello.java --main=hello

would produce a native elf file that does whatever is in the applications, i think it converts java to c .

gcj -C hello.java

thats creates a class file that can be used with as java hello

doing simply gcj hello.java
will not work, as gcj does not know where the main is

anyway there are other things if u look at man gcj

it compiles a lot faster than javac

daziplqa 06-21-2006 10:50 PM

thanx all,
mr : boredandblogging ; it is free for developement use only, right??

elluva 06-22-2006 03:23 AM

Quote:

Originally Posted by geletine
would produce a native elf file that does whatever is in the applications, i think it converts java to c .

I don't think so, I think it just uses the internal code representation used within GCC which more or less language independent. Gcj is just a frontend to gcc that checks java code and transforms it to this intermediary representation. A backend is then chosen (e.g. java bytecode, native i386,...) to compile this representation to binary.

I am not sure about the above, but this is a widely used way to write a compiler ;).

boredandblogging 06-22-2006 04:28 AM

Quote:

Originally Posted by daziplqa
thanx all,
mr : boredandblogging ; it is free for developement use only, right??

no, its free to use in a commercial environment too.

jlliagre 06-22-2006 06:57 AM

Correct, the Java JDK has been freely dowloadable an free to use in both development and production since its first release, more than ten years ago.

Not only Java, but almost all software available to end-users from Sun Microsystems is downloadable and usable for free, even for production use.

This includes development tools (C, C++, Java), O/S (Solaris), (web, directory, messaging, calendar, application, instant messaging, portal, ...) servers, StarOffice (Solaris version), and more.

geletine 06-22-2006 12:14 PM

Quote:

Originally Posted by elluva
I don't think so, I think it just uses the internal code representation used within GCC which more or less language independent. Gcj is just a frontend to gcc that checks java code and transforms it to this intermediary representation. A backend is then chosen (e.g. java bytecode, native i386,...) to compile this representation to binary.

I am not sure about the above, but this is a widely used way to write a compiler ;).

i am not entirely sure what you mean by internal code representation used within GCC, could you explain?


All times are GMT -5. The time now is 10:50 PM.