1

So I just downloaded mingw-w64-bin_i686-mingw_20110410.zip from here (GCC 4.7 apparently), and discovered it had a very recent version of the GCJ compiler.

I tried using it, but apparently gcj requires ecj1.exe, which is the Eclipse compiler for Java... so, where do I find a compatible version of the binaries of ECJ and the associated Java libraries that are needed (libgcj, etc.)?

Ideally this would be found on the MinGW-w64 project page, but it doesn't seem to exist.

(I've already tried copying them from a slightly older GCC version; it doesn't work.)

user541686
  • 205,094
  • 128
  • 528
  • 886

3 Answers3

2

The cause for an openSUSE version of the gcc is basically this: If the configure step of the compilation of gcc did not find the ecj.jar file, ecj1 will be missing at the time when gcj, which has just been build, is called. ecj.jar can be taken from ftp://sourceware.org/pub/java/ecj-4.8.jar for example.

The two options are:

i) Put ecj.jar in $HOME/share/java/ecj.jar, reconfigure gcc with ./configure .... --with-ecj-jar=$HOME/java/ecj.jar and recompile gcc. Future compilations with that gcc will not require ecj1 .

ii) Put ecj.jar in $HOME/share/java/ecj.jar and create ecj1(.exe) through a compilation like gcj -o$HOME/bin/ecj1(.exe) --main=org.eclipse.jdt.internal.compiler.batch.GCCMain $HOME/share/java/ecj.jar assuming that the $HOME/bin is in the PATH for subsequent calls of gcj.

The thing that is actually "broken" here the fact that gcc 4.8.* is not shipped by default with ecj.jar at some standard place.

  • Option i) worked for me, but all I had to do was copy the ecj*.jar file to \cygwin\usr\share\java\ecj.jar (without the version). Option ii) also worked but the ecj1.exe should be placed in \cygwin\lib\gcc\i686-pc-cygwin\4.9.2\ (or whatever version you have) but a stub is already there that just runs the jar file copied in from option i) – Peter Quiring Jan 14 '15 at 15:21
0

That is a very old version of a MinGW-w64 toolchain.

I would suggest downloading one of my builds, I've had reports of gcj working (without libgcj, which does not work on Windows), although I can't seem to find a link to the discussion I had long ago with a user. The user's case had something to do with creating a JNI interface or something, which didn't require libgcj.

My old builds can be found here for 32-bit and here for 64-bit. I checked the 4.8 release build, and it contains the gcj compiler.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
-1

Would you be opposed to downloading the source and building it? I looked over the build doc in basic and advanced build docs. I didn't see anything about the GCJ compiler or ECJ, but you'll need gcc 4.5.1 in order to build it.

Marc
  • 4,546
  • 2
  • 29
  • 45
  • Not really "opposed" to it, but I've already probably literally spent more than 24 hours (a few hours each day) compiling various components of GCC on both Windows and Ubuntu, all of which have met with failure. There's always some random error in the middle that crops up, so the instructions don't help... I'd rather just download the binaries that someone actually knew how to build, rather than waste time trying to compile every program I need. :\ And by the way, where would I find the ECJ source anyway? – user541686 Apr 20 '11 at 06:44
  • Sounds like your gcc toolchain might be out of whack. The trunk of the repository is here:http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/. Have you tried just installing the binaries on Ubuntu from the Ubuntu repositories? Apparently it's pretty much self contained (no other dependencies). – Marc Apr 20 '11 at 06:53
  • Ugh I'm just tired of spending so many hours on building it... maybe I'll try again in a month or two, but right now I've just given up on it. I've tried redownloading different versions and everything but nothing's worked, I get a different error each time, sometimes about a random header file, sometimes about missing libraries, etc... that's just not going to be a solution for me unfortunately, though thanks for the suggestion. – user541686 Apr 20 '11 at 06:56
  • Oh well! Sometimes you get the bear and sometimes the bear gets you. Anyway, maybe you'll come across the solution if you step away from it for a while! – Marc Apr 20 '11 at 07:00