delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
x-gfisavedcharset: | Windows-1252 |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
Message-ID: | <C9150052B112D3119E9E0004ACA6E43702EFEAC2@tepg1.tepg.co.uk> |
From: | "Bruce Adams" <bruadams AT tycoint DOT com> |
To: | <cygwin AT cygwin DOT com> |
Subject: | Java (1 of 3): Gcj - Hello world exe (again) |
Date: | Mon, 6 Jan 2003 09:27:52 -0000 |
MIME-Version: | 1.0 |
X-OriginalArrivalTime: | 06 Jan 2003 09:29:06.0625 (UTC) FILETIME=[0F357B10:01C2B566] |
Hi, This ought to be in the FAQ but I couldn't find it. I can't seem to get a hello world program to work as an executable though it works fine with the JVM. I've seen this asked before but not the answer. See code below. 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); } } Makefile ======== JAVAC = gcj JFLAGS = -gstabs all: Hello.class Hello.exe test test: java Hello .\Hello %.class: %.java $(JAVAC) $(JFLAGS) -C $< # note: this will not link unless you install libiconv # using the standard cygwin installer %.exe: %.java $(JAVAC) --main=Hello $(JFLAGS) $< -o $@ Output ====== C:\BruceA\java>make gcj -gstabs -C Hello.java gcj --main=Hello -gstabs Hello.java -o Hello.exe java Hello hello world .\Hello 7 [main] Hello 284 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 33835 [main] Hello 284 open_stackdumpfile: Dumping stack trace to Hello.exe.st Ackdump What have I done wrong? Regards, Bruce A. ============================================================================ Any opinions expressed in this e-mail are those of the individual and not necessarily those of Tyco Electronic Product Group. Any prices for the supply of goods or services are only valid if supported by a formal written quotation. This e-mail and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from Tyco Electronic Product Group are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivery to the intended recipient, be advised that you have received this e-mail in error and that any use is strictly prohibited. In this event, please notify us via e-mail at 'helpdesk DOT tepg AT tycoint DOT com' or telephone on 0121 255 6499 and then delete the e-mail and any copies of it. ============================================================================ -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |