tags:

views:

391

answers:

2

Hi,

I not whether this is the sort of question to be asked on StackOverflow, but I'll ask it anyway.

I am using GCJ (as part of MinGW) on Windows XP SP3 to compile a Java class to an EXE.

The Java Class is:

public class Test

{

public static void main(String args[])
  {

    System.out.println("This is a test.");

   }

}

Now when I run GCJ with the Java source file, it fails with:

C:\MinGW\bin>gcj --main=Test Test.java
Test.java:0: error: malformed .zip archive in CLASSPATH: C:\Program Files\Java\jdk1.6.0_13\lib\tools.jar/

jc1.exe: out of memory allocating 1342179073 bytes

I then compiled the Java class and run GCJ again, but once again it failed with:

C:\MinGW\bin>gcj --main=Test Test.class

jc1.exe: out of memory allocating 1342179073 bytes

Why is it doing this and what can I do to make GCJ work?

A: 

have you tried with

gcj -g --main=Test -o Test Test.class
stefita
Sorry didn't work. I suspect Jesper is right; I need Java 1.4
Kryten
+1  A: 

Ok I have finally found an answer to the problem. It seems that there is a problem with the MinGW gcj as when I tried the Cygwin version everthing worked.

Kryten
Thanks for posting the resolution; this might be useful for others.
Paul Lammertsma