🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19367

Re: Exit codes, values?

#19367
From: Joe C. Hecht
Date: Sun, 08 Feb 1998 00:00
28 lines
1483 bytes
Q) Application.Main does not return anything. How do I pass back
an exit code to the process that started my application? 

A) You can call the exit() method of the Runtime class. Note that
this will terminate the currently running Java Virtual Machine.
If there is a security manager, its checkExit() method will be
called with the code you are attempting to pass back. This
of course may result in a security exception. If all goes well,
the call to exit() will shut down the currently running Java
Virtual Machine and the exit() method will not return.

JBuilder Example:

// exit, and pass the number 10 as an exit code
      Runtime.getRuntime().exit(10);

//Batch file example

@ECHO OFF
java untitled1.application1
IF ERRORLEVEL 10 ECHO Java App Error #10

-- 
Joe C. Hecht
joehecht@gte.net 
(850) 689-0877 121 Louise Dr. Crestview, FL 32536
http://home1.gte.net/joehecht/index.htm
Technical Details
Message-ID: <34DE3FAE.5E2C@gte.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6aif2n$r744@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,2dda1bca56b203a3
X-Google-Attributes: gidf74b3,public
From: "Joe C. Hecht" <joehecht@gte.net>
Subject: Re: Exit codes, values?
Date: 1998/02/08
Message-ID: <34DE3FAE.5E2C@gte.net>
X-Deja-AN: 323256400
Content-Transfer-Encoding: 7bit
References: <6aif2n$r744@forums.borland.com>
To: Adam Stiles <adam@dpssoft.com>
Content-Type: text/plain; charset=us-ascii
Organization: Offshore Technology
Mime-Version: 1.0
Reply-To: joehecht@gte.net
Newsgroups: borland.public.jbuilder.java.language