Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCJ as Java SDK, dead, long live IcedTea!
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3 ... 24, 25, 26  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sun Sep 11, 2005 2:49 am    Post subject: GCJ as Java SDK, dead, long live IcedTea! Reply with quote

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! :o

___
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 :o
: 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! :o
Quote:
svn co http://overlays.gentoo.org/svn/proj/java/java-overlay/
svn co http://overlays.gentoo.org/svn/proj/java/gcj-overlay/

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Nov 22, 2005 7:21 pm    Post subject: Reply with quote

mod_gcj for Apache 1.3/2.0 looks quite interesting :o
_________________
hear hear
Back to top
View user's profile Send private message
lancelott
Apprentice
Apprentice


Joined: 29 Mar 2005
Posts: 152

PostPosted: Sun Feb 26, 2006 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Mon Feb 27, 2006 12:02 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelott
Apprentice
Apprentice


Joined: 29 Mar 2005
Posts: 152

PostPosted: Mon Feb 27, 2006 12:17 am    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Mon Feb 27, 2006 1:28 pm    Post subject: Reply with quote

with gcj-4.1 / ecj it compiles/runs. no torrent d/l tested yet.
_________________
hear hear
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Thu Mar 02, 2006 6:55 pm    Post subject: Reply with quote

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... :twisted:
... 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 :o
_________________
hear hear
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sat Mar 04, 2006 3:11 pm    Post subject: Reply with quote

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 :o

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
View user's profile Send private message
zxy
Veteran
Veteran


Joined: 06 Jan 2006
Posts: 1160
Location: in bed in front of the computer

PostPosted: Fri Apr 14, 2006 2:36 am    Post subject: Reply with quote

@geki your links are down. Where to get your overlay?
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Fri Apr 14, 2006 10:09 am    Post subject: Reply with quote

thanks, updated
_________________
hear hear
Back to top
View user's profile Send private message
tchernobog
n00b
n00b


Joined: 05 Jan 2004
Posts: 29

PostPosted: Thu Apr 20, 2006 4:04 pm    Post subject: Some experiments Reply with quote

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. 8O
    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
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Thu Apr 20, 2006 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Thu Apr 20, 2006 4:54 pm    Post subject: Reply with quote

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 8O

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
View user's profile Send private message
tchernobog
n00b
n00b


Joined: 05 Jan 2004
Posts: 29

PostPosted: Thu Apr 20, 2006 6:56 pm    Post subject: Reply with quote

codergeek42 wrote:
Bug 21477: "java-config support for gcj" may interest you. :)


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
View user's profile Send private message
davidgurvich
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1063

PostPosted: Sun May 21, 2006 4:11 am    Post subject: Reply with quote

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
View user's profile Send private message
davidgurvich
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1063

PostPosted: Mon May 22, 2006 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Tue May 23, 2006 8:46 am    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue May 23, 2006 8:59 am    Post subject: Reply with quote

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? :o
_________________
hear hear
Back to top
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Tue May 23, 2006 9:54 am    Post subject: Reply with quote

geki wrote:
It seems the function is not implemented correctly or at all or ...
http://developer.classpath.org/doc/

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? :o
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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue May 23, 2006 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message
irondog
l33t
l33t


Joined: 07 Jul 2003
Posts: 715
Location: Voor mijn TV. Achter mijn pc.

PostPosted: Tue May 23, 2006 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue May 23, 2006 11:05 am    Post subject: Reply with quote

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. :o
_________________
hear hear
Back to top
View user's profile Send private message
davidgurvich
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1063

PostPosted: Tue May 23, 2006 11:28 am    Post subject: Reply with quote

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
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue May 23, 2006 11:40 am    Post subject: Reply with quote

davidgurvich Please elaborate 'your method'.
_________________
hear hear
Back to top
View user's profile Send private message
davidgurvich
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1063

PostPosted: Tue May 23, 2006 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2, 3 ... 24, 25, 26  Next
Page 1 of 26

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum