This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcj does not print (PrintWriter, OutputStreamWriter)
- From: Oliver Kullmann <O dot Kullmann at swansea dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 26 Nov 2011 14:30:10 +0000
- Subject: gcj does not print (PrintWriter, OutputStreamWriter)
Hello,
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);
where
out = new PrintWriter(new OutputStreamWriter(System.out, charsetName), true);
using
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.
Oliver