main class not found in project (absurd error)

Well, here it comes regarding the "poor" choice of Main class, thanks a
log! LOL. I changed it in NetBeans IDE 4.1 and now the whole project is
screwed up.

Basically everything is not split into various classes. The project has
three packages and a main package.
The main package is called jtest for example. It had the Main class
generated by NetBeans IDE and now no matter what I do with the bloody thing
it compiles but it just does not run at all!!!!

The main class of the main package is now again the same "poor" name (hey,
it worked before but not it won't) which basically has this skeleton:

package jtest;

public class Main
// my member variables here

public Main()
// Initialize my member variables

public static int main(String[] args)
int exitCode = 0;

// do some processing
return exitCode;

As I mentioned everything compiled AND ran OK before I attempted to rename
Main to something else... Since all attempts to recover the project to its
working condition failed I created a new one and pasted all files (NetBeans
seems to be unable to import files in the project after it has been created,
Visual Studio can).

My main class is again as above. Compilation of the whole project goes fine,
no errors, no warnings (1.5). I set up the command line parameters for
execution in the project's Run properties. When I attempt to run it from the
GUI or from the command line I get:

Exception in thread "main" java.lang.NoSuchMethodError: main

and come on! the method is there and it is static!!!! what kind of crappy
thing is that? On the GUI I get a dialog

jtest.Main class wasn't found in jTest project.
Select the main class:
<No main classes found>

Any ideas how to solve this? I had a working project and after that it is
totally useless.


Relevant Pages

  • Newbie with NetBeans and .JAR files...
    ... I'm taking my first Java course, and we're using the NetBeans IDE. ... I'm trying to use .JAR files: ... compiles and executes fine. ... The package seems to mount just fine: I can open the source files I ...
  • Re: Graph component in Java
    ... package & found it unsuitable for the task. ... You poor, poor thing. ... > you've spent far more time defending your original condescending reply ... And you have spent more time whinging ...
  • Re: Netbeans - importing packages
    ... I'm new in NetBeans IDE. ... create new components with short package name? ... Must I manually edit this? ... It's always possible to edit code by clicking on the Source button in ...
  • Re: Food snob?
    ... read the directions on a package of frozen vegetables? ... What I find extremely interesting is some can go through grade school, pass every grade, yet can't read. ... But because you're not poor you don't get judged when you do it. ...
  • Re: Food snob?
    ... read the directions on a package of frozen vegetables? ... Many parents would get jobs but their car would break down and they'd ... But because you're not poor you don't get judged when you do it. ... does is nitpicked and evaluated and, surprise surprise, they never ...