This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Java (1 of 3): Gcj - Hello world exe (again)


Bruce Adams wrote:

Hello.java (note: case is important in this filename)
==========

class Hello {
public Hello() {};

public static void main(String args[]) {
int returnCode = 0;
System.out.println("hello world\r\n");
System.exit(returnCode);
}
}

lapo@CYBERONE ~
$ export CLASSPATH=

lapo@CYBERONE ~
$ gcj --main=Hello -gstabs Hello.java -o Hello.exe

lapo@CYBERONE ~
$ ./Hello.exe
hello world

The only note is that I had to be sure CLASSPATH was empty or else rt.jar was found before libgcj.jar and I got an error about java.lang.Object being the wrong version.

--
Lapo 'Raist' Luchini
lapo@lapo.it (PGP & X.509 keys available)
http://www.lapo.it (ICQ UIN: 529796)



--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]