Re: gcj: error trying to exec 'ecj1': execvp

David Michel <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Thanks it compiles fine now, but now I get an Exception at runtime:

Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:607)
   at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:103)
   at java.awt.Window.<init>(Window.java:133)
   at java.awt.Frame.<init>(Frame.java:246)
   at javax.swing.JFrame.<init>(JFrame.java:114)
   at nl.kbna.dioscuri.GUI.<init>(dioscuri)
   at nl.kbna.dioscuri.GUI.<init>(dioscuri)
   at nl.kbna.dioscuri.GUI.main(dioscuri)
Caused by: java.lang.ClassNotFoundException:
   at java.lang.Class.forName(natClass.cc:101)
   at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:583)
   ...7 more

I simply run this for all the java source code to produce the object files:
/local/gcc-4_4-branch/install/bin/gcj -O0 -g0 -c "--classpath=./:"
foo.java -o foo.o

and then, link them together with:
/local/gcc-4_4-branch/install/bin/gcj -O0 -g0 --main=GUI foo1.o
foo2.o..... -o ./a.out

Obviously, it seems that it cannot find AWT, but I don't know why and
how to solve this.

Many Thanks in advance for your help

David

2009/4/20 David Michel <[email protected]>
>
> I get an error when doing ./contrib/download_ecj
>
> $ contrib/download_ecj
> [sudo] password for micd:
> Verbose mode on.
> Hash mark printing on (1024 bytes/hash mark).
> 331 Anonymous login ok, send your complete email address as your password
> 230-
>                *** Welcome to the ftp server for sourceware.org/gcc.gnu.org ***
>
>     You are user 20 out of a maximum of 30 authorized anonymous logins.
>     The current time here is Mon Apr 20 13:46:01 2009.
>     If you experience any problems here, contact : overseers at this site
>
>
> 230 Anonymous login ok, restrictions apply.
> Remote system type is UNIX.
> Using binary mode to transfer files.
> 250 CWD command successful
> 200 Type set to I
> local: ecj-latest.jar remote: ecj-latest.jar
> 421 Service not available, remote server has closed connection
> mv: cannot stat `ecj-latest.jar': No such file or directory
>
>
> This might be due to very restrictive firewall settings... so I'll
> download ecj-latest.jar and put it in the gcc source tree as ecj.jar
> and redo the configure ; make ; make install process...
>
> Cheers
>
> David
>
>
> 2009/4/20 Andrew Haley <[email protected]>:
> > David Michel wrote:
> >> Hi Andrew,
> >>
> >> Thanks a lot for this link!
> >>
> >> Do I have to rename the ecj-4.3.jar to ecj.jar to be recognised ?
> >
> > ecj1 is a script that looks like this:
> >
> > #!/bin/sh
> > gij -cp <somepath>/ecj.jar \
> >    org.eclipse.jdt.internal.compiler.batch.GCCMain \
> >    ${1+"$@"}
> >
> >> what do you mean exactly by "topmost source tree" ? Is
> >> ~/gcc-4_4-branch (i.e. the main folder created by the the svn checkout
> >> command) OK ?
> >
> > Yes.
> >
> >> How can I make sure that the ./configure script has "found" it ?
> >
> > Go into the top of the gcc source tree and type
> > ./contrib/download_ecj
> >
> > Andrew.
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.