Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JAR doesn't find main class
JAR doesn't find main class [message #84296] Sat, 09 August 2003 16:43 Go to next message
Eclipse UserFriend
Originally posted by: vk.vonkaenel.net

The JAR exporter and I don't seem to get along well. For some projects I
get a working Jar file, for others I have problems - like now.

I go through the Jar wizard. I've checked all the java classes in a
project, including some packages of mine that are in the same folder as
the main class. Near the end, I identify the main class (using the Browse
- to be sure I don't have a typo). The Jar is created. I check it using a
viewing utility and everything is in the file, including the main class. I
look at the manifest and it properly lists the main class. I have tested
the project within Eclipse, everything works (its a GUI application). No
error log is generated.

In my file manager, when I double click the Jar file (using WinXP pro), I
get the error - "Could not find the main class." I have other jars that I
can invoke, so it's not a problem locating the JRE or some such thing.

Does anyone have a suggestion? Thanks.
Re: JAR doesn't find main class [message #84311 is a reply to message #84296] Sun, 10 August 2003 08:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dar.cs.huji.ac.il

Do you have a Main-Class property in the manifest file ?

David

"Pierre" <vk@vonkaenel.net> wrote in message
news:bh3md1$a9r$1@eclipse.org...
> The JAR exporter and I don't seem to get along well. For some projects I
> get a working Jar file, for others I have problems - like now.
>
> I go through the Jar wizard. I've checked all the java classes in a
> project, including some packages of mine that are in the same folder as
> the main class. Near the end, I identify the main class (using the Browse
> - to be sure I don't have a typo). The Jar is created. I check it using a
> viewing utility and everything is in the file, including the main class. I
> look at the manifest and it properly lists the main class. I have tested
> the project within Eclipse, everything works (its a GUI application). No
> error log is generated.
>
> In my file manager, when I double click the Jar file (using WinXP pro), I
> get the error - "Could not find the main class." I have other jars that I
> can invoke, so it's not a problem locating the JRE or some such thing.
>
> Does anyone have a suggestion? Thanks.
>
Re: JAR doesn't find main class [message #84486 is a reply to message #84311] Mon, 11 August 2003 07:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vk.vonkaenel.net

Yes I do. I've also looked at the other files in the jar and my main class
is there.

"David Rabinowitz" <dar@cs.huji.ac.il> wrote in message
news:bh59j1$b5m$1@eclipse.org...
> Do you have a Main-Class property in the manifest file ?
>
> David
>
> "Pierre" <vk@vonkaenel.net> wrote in message
> news:bh3md1$a9r$1@eclipse.org...
> > The JAR exporter and I don't seem to get along well. For some projects
I
> > get a working Jar file, for others I have problems - like now.
> >
> > I go through the Jar wizard. I've checked all the java classes in a
> > project, including some packages of mine that are in the same folder as
> > the main class. Near the end, I identify the main class (using the
Browse
> > - to be sure I don't have a typo). The Jar is created. I check it using
a
> > viewing utility and everything is in the file, including the main class.
I
> > look at the manifest and it properly lists the main class. I have
tested
> > the project within Eclipse, everything works (its a GUI application). No
> > error log is generated.
> >
> > In my file manager, when I double click the Jar file (using WinXP pro),
I
> > get the error - "Could not find the main class." I have other jars that
I
> > can invoke, so it's not a problem locating the JRE or some such thing.
> >
> > Does anyone have a suggestion? Thanks.
> >
>
>
Re: JAR doesn't find main class [message #84520 is a reply to message #84486] Mon, 11 August 2003 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Pierre wrote:

> Yes I do. I've also looked at the other files in the jar and my main class
> is there.

> "David Rabinowitz" <dar@cs.huji.ac.il> wrote in message
> news:bh59j1$b5m$1@eclipse.org...
> > Do you have a Main-Class property in the manifest file ?
> >
> > David
> >
> > "Pierre" <vk@vonkaenel.net> wrote in message
> > news:bh3md1$a9r$1@eclipse.org...
> > > The JAR exporter and I don't seem to get along well. For some projects
> I
> > > get a working Jar file, for others I have problems - like now.
> > >
> > > I go through the Jar wizard. I've checked all the java classes in a
> > > project, including some packages of mine that are in the same folder as
> > > the main class. Near the end, I identify the main class (using the
> Browse
> > > - to be sure I don't have a typo). The Jar is created. I check it using
> a
> > > viewing utility and everything is in the file, including the main class.
> I
> > > look at the manifest and it properly lists the main class. I have
> tested
> > > the project within Eclipse, everything works (its a GUI application). No
> > > error log is generated.
> > >
> > > In my file manager, when I double click the Jar file (using WinXP pro),
> I
> > > get the error - "Could not find the main class." I have other jars that
> I
> > > can invoke, so it's not a problem locating the JRE or some such thing.
> > >
> > > Does anyone have a suggestion? Thanks.
> > >
> >
> >
Does you main class subclass or reference a class that isn't on the
default classpath? If so, the VM won't be able to load the class and
could report that it is not found. Have you tried running the jar with
the -verbose flag to see what the VM is doing?
Re: JAR doesn't find main class [message #85316 is a reply to message #84296] Wed, 13 August 2003 09:07 Go to previous message
Eclipse UserFriend
Originally posted by: vk.vonkaenel.net

Well, I've narrowed the problem down to my home PC (WinXP pro). At work
(also WinXP), I can jar the project and run the jar file by double clicking
it. At home, I can also run the same jar file. But, when I use Eclipse at
home to jar the file again (using the same settings as those used at work),
I get a jar file that correctly lists the main class in the manifest and
that contains all the .class files in the jar. But when I try invoking it,
I get the error window (titled: Java Virtual Machine Launcher) with "Could
not find main class. Program will exit."
On both machines I use administrator rights.



"Pierre" <vk@vonkaenel.net> wrote in message
news:bh3md1$a9r$1@eclipse.org...
> The JAR exporter and I don't seem to get along well. For some projects I
> get a working Jar file, for others I have problems - like now.
Previous Topic:User mailing lists?
Next Topic:No ScrollBars in ScrollComposite if parent is not the shell
Goto Forum:
  


Current Time: Tue Jul 22 19:53:49 EDT 2025

Powered by FUDForum. Page generated in 0.04102 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top