gcj does not print (PrintWriter, OutputStreamWriter)

Oliver Kullmann O.Kullmann@swansea.ac.uk
Sun Nov 27 03:33:00 GMT 2011


we use

> gcj --version
gcj (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]

I have a simple collection of java-files, constituting a program
"GeneralisedTicTacToe". Compiling the .java-files with "gcj -C"
to .class-files, and then running "java GeneralisedTicTacToe"
it all works, where we use

> java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (suse-0.3.2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

However, when attempting, via "gcj --main=GeneralisedTicTacToe *.class",
to create a binary via gcj, we don't get error messages, but
the resulting binary does not work properly: it has problems with
output to standard output as well as input from standard input.

The problem with standard output is easier to describe: It just
prints nothing, when calling
out.printf(format, args);
out = new PrintWriter(new OutputStreamWriter(System.out, charsetName), true);
import java.io.PrintWriter;
import java.io.OutputStreamWriter;

I didn't find such problems in the Internet nor on gcj's FAQ.

Thanks for your consideration.


More information about the Gcc-help mailing list