Article View: borland.public.jbuilder.java.language
Article #16562Re: Running from outside JBuilder
From: Tom Heagy
Date: Fri, 12 Feb 1999 00:00
Date: Fri, 12 Feb 1999 00:00
93 lines
4140 bytes
4140 bytes
Thank you Richard and Vasudevan. I took your advice and was able to get my
application running. For anyone else's interest, I specifically did the
following:
1. Set my "PATH" environment variable to include the JBuilder\bin and
java\bin directories. This is necessary simply to run "jre" or "jrew".
example:
"%SystemRoot%\system32;%SystemRoot%;C:\JBuilder2\bin;C:\JBuilder2\java\bin"
2. Set my "CLASSPATH" environment variable to include all the potential
libraries used by JBuilder and Java.
example:
".;C:\JBuilder2\lib\jbcl2.0.jar;
C:\JBuilder2\lib\jbcl2.0-res.jar;
C:\JBuilder2\lib\jgl3.1.0.jar;
C:\JBuilder2\lib\swingall.jar;
C:\JBuilder2\lib\datastore2.0.jar;
C:\JBuilder2\lib\datastore2.0-res.jar;
C:\JBuilder2\lib\jcbwt.jar;
C:\JBuilder2\lib\jcchart.jar
C:\JBuilder2\lib\jctable.jar;
C:\JBuilder2\lib\vbjorb.jar;
C:\JBuilder2\lib\vbjapp.jar;
C:\JBuilder2\lib\vbjgk.jar;
C:\JBuilder2\lib\vbjtools.jar;
C:\JBuilder2\samples;
C:\JBuilder2\myclasses;
C:\JBuilder2\myprojects;
C:\JBuilder2\java\lib\classes.zip"
3. Set my JAVA_COMPILER environment variable.
example: "Javacomp"
4. Set my JAVA_HOME environment variable.
example: "C:\JBuilder2\java"
5. Set my JBUILDER_HOME environment variable.
example: "C:\JBuilder2"
Now I'm finally able to run MY program. To do so, I need to include the
"ClassPath (-cp)" for all of the libraries that my program uses. As Richard
and Vasudevan mentioned, their are 2 ways to run. The first way sends all
system output (including error messages) to the console. For this, I used
"jre". The other method doesn't bring up any window other than the windows of
your application. For this I used "jrew". An example of my execution follows
below.
jrew -cp
".;\JBuilder2\lib\jbcl2.0.jar;\JBuilder2\lib\jbcl2.0-res.jar;\JBuilder2\lib\jgl3.1.0.jar;\JBuilder2\lib\swingall.jar"
Monopoly.Monopoly
The above example assumes that I've already changed directories to my base
application directory. The reason that the class [I'm trying to run] is
written as "Monopoly.Monopoly" is that the file "Monopoly.class" is part of
the "Monopoly" PACKAGE. If I weren't using packages, then I would just write
"Monopoly".
As I am new to Java, somone please correct me if I've mis-stated anything.
-Tom
Vasudevan Srinivasan wrote:
> Hi,
> Instead of javaw.exe try running it with java.exe (or jre.exe): this will
> atleast show the DOS window and the exceptions thrown.
> From the exceptions you can find what is missing. also see what is in your
> classpath. (just type "set" in the commandprompt and you will see the
> contents of classpath).
>
> Goodluck
> Vasu
>
> Tom Heagy wrote:
>
> > Can someone point me to instructions on how to run my JAVA program from
> > outside JBuilder?
> >
> > I've written a GUI application that makes use of a number of different
> > libraries (Swing, JBCL etc) and everything runs fine when I'm in
> > JBuilder, but now I want to be able to run the program without first
> > opening JBuilder.
> >
> > I thought I was just supposed to call [from a DOS command window]
> > "javaw" following by the name of the class containing "main". When I
> > try this, nothing happens - and I mean NOTHING. I don't get any error
> > messages or anything. It simply returns to the command prompt. It even
> > does this if I don't follow javaw with ANY class name. What I am doing
> > wrong?
> >
> > -Tom
> > tom.heagy@sciatl.com
Technical Details
Message-ID:
<36C436C3.F0111FC8@sciatl.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36C2E9DE.BBD1BE60@sciatl.com> <36C32192.43924894@netrisk.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2c9ebab660bee1e4 X-Google-Attributes: gidf74b3,public From: Tom Heagy <tom.heagy@sciatl.com> Subject: Re: Running from outside JBuilder Date: 1999/02/12 Message-ID: <36C436C3.F0111FC8@sciatl.com> X-Deja-AN: 443616411 Content-Transfer-Encoding: 7bit References: <36C2E9DE.BBD1BE60@sciatl.com> <36C32192.43924894@netrisk.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language