This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
args[0] problem
- From: "HEINECKE Johannes FTRD/DMI/LAN" <johannes dot heinecke at rd dot francetelecom dot com>
- To: <java at gcc dot gnu dot org>
- Date: Wed, 21 Aug 2002 16:28:11 +0200
- Subject: args[0] problem
Hello,
I have just compiled and installed succesfully gcc/gcj 3.2
on a solaris 2.8 box.
gcj works fine but
the first argument of command line arguments in java-main functions
is prefixed a '?',
so
public class HelloWorld {
public static void main(String [] args) {
System.out.println("Hello");
System.out.println(args[0]);
System.out.println(args[1]);
}
}
compiled with gcj -Wmain --main=HelloWorld -o HelloWorld HelloWorld.java
and launched
HelloWorld aaa bbb
writes
Hello
?aaa
bbb
onto the console
Any idea why this is so? (with javac and java it works as expected
thanks a lot
Johannes
--
Johannes Heinecke
France Télécom R&D, DMI/GRI/Langues Naturelles
Email: johannes(dot)heinecke(at)francetelecom(dot)com