🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2394

Re: Newby Question

#2394
From: James A. Schulz
Date: Mon, 23 Oct 2000 00:00
77 lines
3823 bytes
Joi,

The Main function has the required form.  The error I get when I try to run
the project is:

    Could not find the main class.  Program will exit.

Presumably this is something about the myriad of different folders required
for a project.
So, let me frame my question again:

    1.  I have a file  ThisExample.java.  It lives in a folder called JAVA
STUFF.

    2.  I start JB4 and do File|New Project.  I name my project test and
accept all of the defaults.  This creates a folder
c:\windows\jbproject\test and puts two files (test.html and test.ppx) into
that folder.  I now do Project|Add Files/Packages and navigate to my JAVA
STUFF folder and choose ThisExample.java.  The IDE is updated with
ThisExample.java and its various functions.  Now I go to Project|Properties,
and then to the Run tab and the Application tab and click the elipsis
button.  I get a dialog which shows a Main Class drop-down at the top
(containing only "ThisExample"), and below that a list (beginning with
folders: com, demos, java...and ending with what I take to be a files, i.e.
...surface, texture chooser, tools.  "ThisExample" does not appear on that
list.  If I click OK and then try to run the project I get the "Could not
find main class." error.  Am I missing a step somewhere?

thanks

James

"Joi Ellis" <joi@joi.aravox.com> wrote in message
news:8t1pcu$qop5@bornews.borland.com...
> James A. Schulz <jaschulz@wiseware.com> wrote:
> > Michael,
>
> > OK.  I did all that...up to the point of choosing my main class.  In the
> > drop down all I see is the name of the source file, i.e.
ThisExample.java.
> > I cannot expand that item.  If I choose ThisExample.java as my Main
class, I
> > get a "cannot find main class" error when I run the project.  The source
> > (ThisExample.jave) does include a Main function but I don't understand
how I
> > am supposed to point JBuilder to that function.
>
> > Any suggestions would be appreciated.
>
> You only have to point at the class which contains the main() method.
> You aren't expected to point at the method itself.
>
> Question:  You state above that you're pointing at ThisExample.java.
> Is that what shows up in the class browser?  Or is it just ThisExample?
> If there really is a .java showing up in the class browser, something
> is wrong with the project somewhere.
>
> Note that java is very particular about the signature of the main method.
> It must look like:
>
>   public static void main(String[] args) {
>     blah...
>   }
>
> The only leeway you have is in the name of the array, args.  You can
> change the name, but you can't change anything else.  If you change
> anything else, java won't execute the application properly, if at all.
>
>
> --
> Joi Ellis                    Software Engineer
> Aravox Technologies          joi@aravox.com, gyles19@visi.com
>
> No matter what we think of Linux versus FreeBSD, etc., the one thing I
> really like about Linux is that it has Microsoft worried.  Anything
> that kicks a monopoly in the pants has got to be good for something.
>            - Chris Johnson
Technical Details
Message-ID: <8t1rq2$qp97@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8stob4$hjb1@bornews.borland.com> <39f2ec4b_1@dnews> <8t1b28$mbv10@bornews.borland.com> <8t1pcu$qop5@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,66c65841f86ddcb1
X-Google-Attributes: gid1089d0,public
From: "James A. Schulz" <jaschulz@wiseware.com>
Subject: Re: Newby Question
Date: 2000/10/23
Message-ID: <8t1rq2$qp97@bornews.borland.com>
X-Deja-AN: 684888110
References: <8stob4$hjb1@bornews.borland.com> <39f2ec4b_1@dnews> <8t1b28$mbv10@bornews.borland.com> <8t1pcu$qop5@bornews.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Reply-To: "James A. Schulz" <jaschulz@wiseware.com>
Newsgroups: borland.public.jbuilder.java.api