Executable JARs: Main class not found...

Having suffered with this problem for a few hours, and finding here that a lot of other people have too, I thought I'd share my findings...

Obviously if you haven't included your main class, or have refererred to it incorrectly in the manifest then this error will occur. However, this was not the problem with mine.

It turns out that this error message is also returned if any classes used by the main class cannot be found (e.g. my main used com.borland.jbcl.XYLayout but I hadn't included this in the jar).

As the error message provides no way of knowing what is missing, I found it useful to start with a very basic class, and build it up gradually until the error occured. This way I was able to work out what was missing. I then put it in my jar and everything was OK.

HTH,

Neil.

[833 byte] By [neilr3] at [2007-9-26 1:29:47]
# 1
Thanks for sharing this, it was very useful !stephane
stephmor at 2007-6-29 1:26:57 > top of Java-index,Desktop,Deploying...