View previous topic :: View next topic |
Author |
Message |
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Sun Sep 11, 2005 2:49 am Post subject: GCJ as Java SDK, dead, long live IcedTea! |
|
|
wrt the topic:
GCJ as Java SDK, dead(not quite true, yah...), long live IcedTea!(or... better to get things into OpenJDK quicker or so)
... there is always a con to a pro and a pro to a con .... bladat
have fun!
___
icedtea-6 utilizes openjdk-6 core
: injects code of gnu-classpath instead of the binary plugs from sun
: implements openjdk-7 hotspot, thanks gnu_andrew
: experimental Xrender support to speedup Java2D code
geki, experimental version (can be found here)
dev-java/icedtea-6.1.4.14_pre20081209
: openjdk-6_beta14
: hotspot 14.0_build09
___
gcj is just no true replacement for sun-jdk or blackdown-jdk
it is quite interesting to see how far it gets
gcj-overlay as of 20080429 unmaintained!
migrated packages for latest and greatest ported packages!
guide
http://overlays.gentoo.org/proj/java/wiki/GCJ_as_a_JDK
got some strange failing code? API incompatible? check ...
http://developer.classpath.org/doc/ _________________ hear hear
Last edited by geki on Wed Dec 10, 2008 11:17 am; edited 80 times in total |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Tue Nov 22, 2005 7:21 pm Post subject: |
|
|
mod_gcj for Apache 1.3/2.0 looks quite interesting _________________ hear hear |
|
Back to top |
|
|
lancelott Apprentice
Joined: 29 Mar 2005 Posts: 152
|
Posted: Sun Feb 26, 2006 11:55 pm Post subject: |
|
|
I see you've updated this...
Anyway, would it be possible to just use the gcj that comes with gcc? I've found all the equivalents for the env variables except JAVA_HOME and JDK_HOME
Code: | export JDK_HOME=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223
export JAVA_HOME=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223
export JAVAC=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223/gcj
export JAVA=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223/gij
export JAVACMD=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223/gij
export JAR=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-pre20060223/fastjar |
I'm not really sure about them... _________________ Desktop: AMD Athlon 64 3000+ @ 2.15GHz | 7600GT 256MB | 320GB + 250GB SATA 3.0 | Creative X-Fi XtremeGamer | Gentoo Linux amd64
Server: Intel Pentium 2 MMX 350MHz | 30GB HDD | Gentoo Linux x86 |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Mon Feb 27, 2006 12:02 am Post subject: |
|
|
it looks ok to me. edit well, if you got some lib/ and include/ directories there.
have a look at my overlay then for java-config-2 integration. _________________ hear hear |
|
Back to top |
|
|
lancelott Apprentice
Joined: 29 Mar 2005 Posts: 152
|
Posted: Mon Feb 27, 2006 12:17 am Post subject: |
|
|
I might just use your overlay. Seems like too much trouble otherwise. So does azureus work now? _________________ Desktop: AMD Athlon 64 3000+ @ 2.15GHz | 7600GT 256MB | 320GB + 250GB SATA 3.0 | Creative X-Fi XtremeGamer | Gentoo Linux amd64
Server: Intel Pentium 2 MMX 350MHz | 30GB HDD | Gentoo Linux x86 |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Mon Feb 27, 2006 1:28 pm Post subject: |
|
|
with gcj-4.1 / ecj it compiles/runs. no torrent d/l tested yet. _________________ hear hear |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Thu Mar 02, 2006 6:55 pm Post subject: |
|
|
fun post for my azureus merge times
my testbox is a centrino 1.6GHz with 512mb ram
gcj native library/binary build needs a lot of ram
you should have minimum 1gb ram better more... 2gb... 4gb...
... otherwise you could get hardlocks after hours of swapping
Quote: | # genlop -t azureus
* net-p2p/azureus
Tue Feb 14 13:30:27 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 17 minutes and 16 seconds.
Fri Feb 17 16:41:39 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 1 minute and 27 seconds.
Thu Feb 23 01:02:06 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 34 seconds.
Mon Feb 27 01:15:14 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 28 seconds.
Mon Feb 27 01:16:00 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 28 seconds.
Thu Mar 2 19:54:29 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 1 hour, 26 minutes and 33 seconds. |
Feb 14: gcj bytecompile source
Feb 17: gcj bytecompiled ecj bytecompile source
Feb 23,27: native compiled ecj bytecompile source
Mar 2: native compiled ecj bytecompile source, gcj build azureus native library
ant build times
bytecompiled ecj bytecompile source ... 1m25s
native compiled ecj bytecompile source ... 25s
native library of ant, native compiled ecj bytecompile source ... 18s
now, now, if runtime speeds up like that ... evil _________________ hear hear |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Sat Mar 04, 2006 3:11 pm Post subject: |
|
|
update
Quote: | Fri Mar 3 21:15:36 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 38 minutes and 31 seconds. |
edit
Quote: | Tue Mar 7 17:06:54 2006 >>> net-p2p/azureus-2.4.0.0
merge time: 6 minutes and 4 seconds. | This is the same box with 2GB of ram
edit
took ebuild for bcprov from gentoo-java-experimental overlay
- seems to do fine _________________ hear hear
Last edited by geki on Tue May 23, 2006 9:44 am; edited 1 time in total |
|
Back to top |
|
|
zxy Veteran
Joined: 06 Jan 2006 Posts: 1160 Location: in bed in front of the computer
|
Posted: Fri Apr 14, 2006 2:36 am Post subject: |
|
|
@geki your links are down. Where to get your overlay? |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Fri Apr 14, 2006 10:09 am Post subject: |
|
|
thanks, updated _________________ hear hear |
|
Back to top |
|
|
tchernobog n00b
Joined: 05 Jan 2004 Posts: 29
|
Posted: Thu Apr 20, 2006 4:04 pm Post subject: Some experiments |
|
|
Okay, I'm experimenting the new overlay, and in particular gcj-jdk. Thanks guys for your wonderful work , you deserve it.
However, I've noticed some not-so-nice things:
- Although the Eclipse-sdk ebuild says you need at least 768Mb of RAM to compile it (I've got exactly those), converting from JARs to to native libraries with gcj takes a lot more. In fact, after four hours of swapping to another 1Gb partition, my PC gave in and the Linux kernel killed the jc1 process. D'oh.
Probably you should change the ebuild to say "you need > 1.5Gb RAM to compile eclipse with gcj to native". In particular I've seen the org.eclipse.jdt.core*.jar going summing up into a >110Mb .s (assembler) file before the jc1 process was killed. That's quite insane for a ~7Mb JDT UI jar (the 'JDT core' one is about 4Mb) - at least IMHO. I wonder what the compiler is exactly doing under the hood.
1M$-worth question: Isn't there a way to unpack those JARs, compile every file separately and then link them together into a library again?
- Cannot compile gjdoc due to an error about not finding a class from javax.xml. I wonder why the rest of the compilation process uses "javac" as a frontend (the one that comes with the gcj-jdk pkg, should be eclipse-ecj), while here gcj is called explicitly. It spits:
Code: | gcj --classpath=. -fassume-compiled -I./src -I. -I/usr/share/antlr/lib/antlr.jar -I. -g -O2 -c src/gnu/classpath/tools/doclets/xmldoclet/Driver.java -fPIC -o src/gnu/classpath/tools/doclets/xmldoclet/.libs/Driver.o
./src/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.java:60: error: Class or interface `javax.xml.parsers.ParserConfigurationException' not found in import |
I tried to run a program I did some time ago (a small Java chat program), which uses the AWT. Unfortunately, when I try to run "java Client" I get this error:
Code: | Exception in thread "Thread-1" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
at java.awt.Toolkit.getDefaultToolkit (libgcj.so.7)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (libgcj.so.7)
at java.awt.Window.<init> (libgcj.so.7)
at java.awt.Frame.<init> (libgcj.so.7)
at javax.swing.JFrame.<init> (libgcj.so.7)
at frontend.LoginWindow.<init> (LoginWindow.java:32)
at Client.run (Client.java:35)
Caused by: java.lang.ClassNotFoundException: gnu.java.awt.peer.gtk.GtkToolkit
at java.lang.Class.forName (libgcj.so.7)
at java.lang.Class.forName (libgcj.so.7)
at java.awt.Toolkit.getDefaultToolkit (libgcj.so.7)
...6 more
|
Then I discovered it isn't the only program that gives me this problem: every program with a GUI does that (at least, in bytecode, haven't tried compiling to native yet). However, the libjawt.so symlink is in place, and lib-gnu-java-awt-peer-gtk.so is present and a quick "nm -DC" on it confirmed it is okay. "ldd libjawt.so" shows me it resolves correctly to "lib-...-peer-gtk.so".
Any ideas here on what I am doing wrong?
_________________ One of the universal rules of happiness is: always be wary of any helpful item that weighs less than its operating manual. -- (Terry Pratchett, Jingo) |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Thu Apr 20, 2006 4:19 pm Post subject: |
|
|
Bug 21477: "java-config support for gcj" may interest you. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Thu Apr 20, 2006 4:54 pm Post subject: |
|
|
tchernobog
gcj uses up to 1.4GB ram to build native libraries. not more.
ask the gcj developers why.
edit just wrong. saw one Jar eating more than 2GB
no idea about gjdoc issue. did not try to build it recently.
azureus does fine here.
codergeek42
I should have added a comment there. heh. _________________ hear hear
Last edited by geki on Tue May 23, 2006 9:46 am; edited 2 times in total |
|
Back to top |
|
|
tchernobog n00b
Joined: 05 Jan 2004 Posts: 29
|
Posted: Thu Apr 20, 2006 6:56 pm Post subject: |
|
|
Thanks, but I'm in the CC list for 21477 since about a year and a half. Not much discussion is going on.
For gjdoc, maybe I found the problem doing a revdep-rebuild. I had still a gcc-3.4.6 installed with the "gcj" USE flag on, and after I upgraded expat to 2.0, it broke those gcj libraries.
My guess is that in the system library path the old gcc lib directory is searched before the one inside "/opt/gcj-4.0.1". I'm now rebuilding gcc without that flag. If it fixes the gjdoc problem, and maybe even the AWT one, I'll report back. Is it true, it could be sensible to alert users not to use gcc versions compiled with the "gcj" USE flag.
As for gcj's memory hunger, I'm certainly not blaming gentoo developers, that's for sure. Just wondering, and yes: if I get some spare time I'll ask some GCC dev about it. Still the question remains: is it possible to unpack JARs and compile files therein contained separately, and link them at the end?
Update: yes, a broken GCC was the deal; recompiling it solved both gjdoc compilation and AWT run-time problems -- well, it starts, although widgets are all screwed up. Cool . _________________ One of the universal rules of happiness is: always be wary of any helpful item that weighs less than its operating manual. -- (Terry Pratchett, Jingo) |
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Sun May 21, 2006 4:11 am Post subject: |
|
|
I don't know about other ARCH, but on ppc I can run eclipse only with gcj as jvm. Crashes rapidly using ibm-jdk-bin. Only odd thing is memory use.
EDIT: I am using the java-experimental eclipse-sdk adding -compilelibs, not gcj. |
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Mon May 22, 2006 6:58 pm Post subject: |
|
|
Have emerged eclipse-sdk-3.2_rc5 from gcj-overlay. Followed instructions from earlier to setup gcj-jdk and had to modify the ebuild on my ppc system in the following fashion:
Quote: | -jav5home /usr/share/classpath/
-java5home /opt/ibm-jdk-bin-1.5.0/ | There were two instances of that.
Secondly, though I don't know if this is necessary:
Quote: | -I$JAVA_HOME/include/linux
-I$JAVA_HOME/include | No jdk on my system has a linux directory under JAVA_HOME.
Primarily done because eclipse fails to run under ibm-jdk-bin, any version. |
|
Back to top |
|
|
irondog l33t
Joined: 07 Jul 2003 Posts: 715 Location: Voor mijn TV. Achter mijn pc.
|
Posted: Tue May 23, 2006 8:46 am Post subject: |
|
|
Has anyone any idea why this code doesn't work with gjc.
Code: |
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.*;
import javax.imageio.*;
public class HelloWorld {
public static void main(String args[]) {
BufferedImage bla;
bla = new BufferedImage(10,10,BufferedImage.TYPE_INT_RGB);
File fa;
File fo;
try {
fa = new File("in.bmp");
bla = ImageIO.read(fa);
fo = new File("out.bmp");
ImageIO.write(bla, "bmp", fo);
} catch(Exception x) { System.out.println("ellende");}
}
}
|
It does work when using sun JDK. I have a big Java project and the only thing that doesn't work (when using GCJ) is the part that cals ImageIO.write(). _________________ Alle dingen moeten onzin zijn. |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Tue May 23, 2006 8:59 am Post subject: |
|
|
It seems the function is not implemented correctly or at all or ...
http://developer.classpath.org/doc/
edit
With GNU Classpath ImageIO.write wants your 'bla' to be a RenderedImage.
Is that incompatible? _________________ hear hear |
|
Back to top |
|
|
irondog l33t
Joined: 07 Jul 2003 Posts: 715 Location: Voor mijn TV. Achter mijn pc.
|
Posted: Tue May 23, 2006 9:54 am Post subject: |
|
|
Is this site in sync with the current GCJ?
at: http://www.kaffe.org/~stuart/japi/htmlout/h-jdk14-classpath.html
This says imageio is implemented 100%.
Code: | javax. imageio: 100% |
Quote: |
edit
With GNU Classpath ImageIO.write wants your 'bla' to be a RenderedImage.
Is that incompatible? | BufferedImage is an implementation of RenderedImage. It sould work imho.
B.T.W. imageio.read() also excepts. _________________ Alle dingen moeten onzin zijn. |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Tue May 23, 2006 10:00 am Post subject: |
|
|
You should try gnu-classpath-generics as your bootclasspath to test a newer GNU Classpath version.
Otherwise I recommend you to report this on GNU Classpath's mailing list. _________________ hear hear |
|
Back to top |
|
|
irondog l33t
Joined: 07 Jul 2003 Posts: 715 Location: Voor mijn TV. Achter mijn pc.
|
Posted: Tue May 23, 2006 10:57 am Post subject: |
|
|
After emerging gnu-classpath-generics how can I use it for GCJ?
Thnx very much so far! _________________ Alle dingen moeten onzin zijn. |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Tue May 23, 2006 11:05 am Post subject: |
|
|
What I did:
Quote: | anomalie tmp # javac -bootclasspath /usr/share/classpath/glibj.zip:/usr/share/classpath/tools.zip HelloWorld.java
anomalie tmp # java --classpath .:/usr/share/classpath/glibj.zip:/usr/share/classpath/tools.zip HelloWorld
error1: java.lang.ClassCastException: javax.imageio.stream.MemoryCacheImageInputStream cannot be cast to java.io.InputStream |
Luckily I do not develop Java and neither am in need of javax.imageio.* for packages I use. _________________ hear hear |
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Tue May 23, 2006 11:28 am Post subject: |
|
|
I've actually been using a second x86 box or school computers to run eclipse, prior to trying your method.
It has been very frustrating not being able to do certain things in linux on ppc.
Thank you. |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Tue May 23, 2006 11:40 am Post subject: |
|
|
davidgurvich Please elaborate 'your method'. _________________ hear hear |
|
Back to top |
|
|
davidgurvich Veteran
Joined: 23 Apr 2004 Posts: 1063
|
Posted: Tue May 23, 2006 11:54 am Post subject: |
|
|
I meant using gcj as the jdk. With the java-experimental, migration, and gcj overlays. The first two are for porting gentoo's ebuilds to java-1.5 while allowing packages that require them to still use 1.4. The third, gcj-overlay , allows using gcj as the jdk.
There are various isssues, but no show-stoppers. I haven't tried to reinstall everything using gcj, but plan to do so in incremental fashion.
GCJ uses 2*RAM and half the CPU as ibm-jdk-bin running eclipse. Reasonable tradeoff as gcj requires a large amount of ram anyway and the ibm-jdk crashes eclipse. The result is an eclipse which runs quickly. |
|
Back to top |
|
|
|