args[0] problem

HEINECKE Johannes FTRD/DMI/LAN johannes.heinecke@rd.francetelecom.com
Wed Aug 21 07:28:00 GMT 2002


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /