0

I am testing GNU java compiler. I had installed it from mingw installation manager. When I simply run command "gcj --main=Test Test.java" it gives me following block

G:\Files\Programming\JAVA\#Program>gcj --main=Test Test.java
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libgcj.a(win32.o):
win32.cc:(.data+0x0): multiple definition of `_CRT_MT';
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(crtst.o):(.bss+0x0): first defined here
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -liconv
collect2: ld returned 1 exit status

Test.java

public class Test
{
  public static void main(String args[])
  {
    System.out.println("This is a test.");
  }
}

What to do next???

sepp2k
  • 363,768
  • 54
  • 674
  • 675
Bhadrik
  • 43
  • 7
  • 3
    The gcj compiler is a "dead" product. It is no longer maintained and has been removed from the GCC source tree; see https://en.wikipedia.org/wiki/GNU_Compiler_for_Java. My advice would be to not waste your time testing it. – Stephen C Jan 25 '20 at 07:45
  • 1
    If you said why you are "testing" it, we could suggest better alternatives. – Stephen C Jan 25 '20 at 07:46
  • Where did you get this distribution of Mingw? You probably need to download and install additional packages. (And yes, GCJ is pretty much dead at this point.) – Florian Weimer Jan 25 '20 at 08:34
  • @Florian Weimer, I got it from official MinGW download site and it automatically select additional packages related to GCJ, it should work. – Bhadrik Jan 26 '20 at 08:29
  • I simply want to compile Java code into executable file not into bytecode. Is it possible? – Bhadrik Jan 26 '20 at 08:31

0 Answers0