-2

Possible Duplicate:
How to create a .jar file that actually runs?

The computer can't find the main class when I turn my classes into a jar file. I can run it from the command line but not by double clicking it! When i double click it, it says Can not find main class: robert.Start (Start is my main class!) Can someone help me please? I have a manifest file and everything and this is whats written in it

Manifest-Version: 1.0
Class-Path: .
Main-Class: robert.Start

And my directories are like this:

inside the Interest.jar there is:

META-INF

robert

Inside robert are my classes

Can someone help me please? even when i don't create the manifest file manually it still does not run!

I am using windows 7.

I figured out the problem. It is when i run the program with jre7 it doesn't work. BUT with jre6 it works fine! I wonder why :/

Community
  • 1
  • 1
mrspy1100
  • 41
  • 1
  • 1
  • 4

1 Answers1

0

You didn't package robert.Start correctly.

Open the JAR and look for Start.class. When you find it, make sure that the path is robert. If it's not, you have your answer.

CLASSPATH could an issue as well. If you don't use the -cp option when you run, you'll have to have Class-Path set in the manifest as well.

duffymo
  • 305,152
  • 44
  • 369
  • 561