3

I'm creating an exe with JSmooth. It builds fine but then says "Could not find the main class: MyProgram. Program will exit". The .jar file runs great. This is it's manifest file (with a new line at the end):

Mainifest-Version: 1.0
Main-Class: MyProgram

In JSmooth I have:

  • Set the skeleton to Windowed Wrapper
  • Executable binary is "MyProgram.exe"
  • Main class field is "MyProgram"
  • Then I included the MyProgram.jar file into the "Classpath" section of JSmooth.

Is there something I am missing? My main class in Java is:

public class MyProgram extends JPanel implements ActionListener, 
PropertyChangeListener {

This is how I am building the .jar:

jar cmf mainClass MyProgram.jar *.class

My manifest file is "mainClass" and it contains what I first put above.

Thanks.

carget
  • 77
  • 6
  • Had you considered using [Java Web Start](http://stackoverflow.com/tags/java-web-start/info) to deploy this Swing based desktop app.? Not only does JWS offer x-plat install, but also more chance of getting help (judging by the 14 followers for JWS vs. 0 for JSmooth). – Andrew Thompson Dec 24 '11 at 03:00

1 Answers1

0

What package is MyProgram in? From what I see in the manifest, it looks like its in the default package. Maybe JSmooth doesn't handle that?

BillRobertson42
  • 12,602
  • 4
  • 40
  • 57
  • Not to be a noob, but how should I go about dong that? What would need to be changed in my manifest? – carget Dec 24 '11 at 02:47
  • You would need to add a package statement to your source file as the first line. e.g. package foo; Then, you need to create a sub-folder under your source directory called "foo" (it must match the package name exactly), and move your source file to there, do a clean build. Then change the manifest to say foo.MyProgram. If you use Netbeans (for example), it will do all of this for you with a simple refactoring. It will also build the executable jar files for you too if you use the basic Java application project. – BillRobertson42 Dec 24 '11 at 04:39