Cannot find main class

I

Ike

I have a client who has two jar files, Hydroline.jar and LiquidLnF.jar, in a
directory on WinXP machine. when he goes to that directory, and enters at a
DOS prompt:

javaw -cp Hydroline.jar;LiquidLnF.jar HydroLine.HydroLine

He gets a dialog box that says "Java Virtual Machine Loader.....Could not
find the main class. Program will exit."

The main class is HydroLine.HydroLine, as specified in the HydroLine.jar's
manifest file. Additionally, the class HydroLine.HydroLine is in that jar
file.

When I go to run this on my machine, it works fine. Anyone have any ideas
what might be the problem here? Thanks. -Ike
 
M

Manish Pandit

I have a client who has two jar files, Hydroline.jar and LiquidLnF.jar, in a
directory on WinXP machine. when he goes to that directory, and enters at a
DOS prompt:

javaw -cp Hydroline.jar;LiquidLnF.jar HydroLine.HydroLine

He gets a dialog box that says "Java Virtual Machine Loader.....Could not
find the main class. Program will exit."

The main class is HydroLine.HydroLine, as specified in the HydroLine.jar's
manifest file. Additionally, the class HydroLine.HydroLine is in that jar
file.

When I go to run this on my machine, it works fine. Anyone have any ideas
what might be the problem here? Thanks. -Ike

Can you try:

java -jar HydroLine.jar ?

-cheers,
Manish
 
O

Oliver Wong

Ike said:
I have a client who has two jar files, Hydroline.jar and LiquidLnF.jar, in
a directory on WinXP machine. when he goes to that directory, and enters
at a DOS prompt:

javaw -cp Hydroline.jar;LiquidLnF.jar HydroLine.HydroLine

He gets a dialog box that says "Java Virtual Machine Loader.....Could not
find the main class. Program will exit."

The main class is HydroLine.HydroLine, as specified in the HydroLine.jar's
manifest file. Additionally, the class HydroLine.HydroLine is in that jar
file.

When I go to run this on my machine, it works fine. Anyone have any ideas
what might be the problem here? Thanks. -Ike

I think the recommended way of running an application in a jar is to use
the "-jar" flag, as in "java -jar Hydroline.jar". The Hydronline.jar's
manifest file would specify the main class, and any other jar it depends on
(i.e. the LiquidLnF.jar). See
http://java.sun.com/docs/books/tutorial/deployment/jar/run.html

- Oliver
 
K

Knute Johnson

Ike said:
I have a client who has two jar files, Hydroline.jar and LiquidLnF.jar, in a
directory on WinXP machine. when he goes to that directory, and enters at a
DOS prompt:

javaw -cp Hydroline.jar;LiquidLnF.jar HydroLine.HydroLine

He gets a dialog box that says "Java Virtual Machine Loader.....Could not
find the main class. Program will exit."

The main class is HydroLine.HydroLine, as specified in the HydroLine.jar's
manifest file. Additionally, the class HydroLine.HydroLine is in that jar
file.

When I go to run this on my machine, it works fine. Anyone have any ideas
what might be the problem here? Thanks. -Ike

-cp and -jar are mutually exclusive and -jar has priority. You cannot
specify a classpath with the -cp option if you specify the -jar option.
All classpath arguments must be in the manifest file for jarred
applications.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top