[nbusers] Re: Could not find the main class. Even on hello world!

  • From: Ion Iovu < >
  • To:
  • Subject: [nbusers] Re: Could not find the main class. Even on hello world!
  • Date: Mon, 26 Nov 2012 11:18:26 +0200

leigero,

I understand you are able to run the project from within the IDE, however you 
want to run it like that:
java -jar BrokenJava.jar

For it to work, you will need to move the BrokenJava class from the default 
package. Executable jars don't work with classes in the default package


On Nov 26, 2012, at 11:11 AM, Stadelmann Josef wrote:

> It is just a two click project, Can't say what you do wrong. I have done 
> the same Project, got the same folders, no-package-name, exact the same 
> screen shoots. So I suggest you de-install all from NetBeans and re-install 
> NetBeans again. There must be an inconsistency somewhere. Josef
> 
> -----Urspr√ľngliche Nachricht-----
> Von: leigero 
> [mailto: ]
>  
> Gesendet: Sonntag, 25. November 2012 06:28
> An: 
> 
> Betreff: [nbusers] Could not find the main class. Even on hello world!
> 
> I have done all of the steps everybody above have suggested and have yet to 
> find a solution to this problem.
> 
> I don't know why NetBeans would have an automatic setting somewhere that 
> keeps any projects from working. It is quite frustrating.
> 
> I DEFINITELY have a main class this happens on every project I create down 
> to the simplest project (brand new project with nothing changed, maybe add 
> a hello world line in there) still won't find main class.
> 
> I tell it to create a main class upon creating the project, I check the 
> main class in the properties and the main class listed there is the class 
> that contains the public static void main (String[] args) line.
> 
> I've tried unchecking that block I've tried renaming the main classes I've 
> done everything I can think of and i still cant get a single .jar file to 
> run.
> 
> What is most baffling is that it LOOKS like all the parts are there. I see 
> the main class, the properties has the correct main class listed and yet it 
> still won't run.
> 
> 
> 
> 
> Attachments: 
> http://forums.netbeans.org//files/broken_159.png
> 



[nbusers] Could not find the main class. Even on hello world!

leigero 11/25/2012

[nbusers] Re: Could not find the main class. Even on hello world!

Benno Markiewicz 11/25/2012

[nbusers] Re: Could not find the main class. Even on hello world!

Stadelmann Josef 11/26/2012

[nbusers] Re: Could not find the main class. Even on hello world!

Ion Iovu 11/26/2012

[nbusers] Re: Could not find the main class. Even on hello world!

Ion Iovu 11/26/2012

[nbusers] Re: Could not find the main class. Even on hello world!

Wade Chandler 11/26/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close