NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

I am having problem in Main class

 
Post new topic   Reply to topic    NetBeans Forums -> SOA Users
View previous topic :: View next topic  
Author Message
bharat_0007us



Joined: 21 Jun 2010
Posts: 3

PostPosted: Thu Jun 24, 2010 1:58 pm    Post subject: I am having problem in Main class Reply with quote

Hi,

I have created a Java class with main method.

when I am running it, I am getting the following error...

java.lang.NoClassDefFoundError: Files\NetBeans
Caused by: java.lang.ClassNotFoundException: Files\NetBeans
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Files\NetBeans. Program will exit.
Exception in thread "main" Java Result: 1[/b]


Do any one have idea, who to resolve this issue?
Back to top
Smurfi



Joined: 23 Oct 2008
Posts: 33

PostPosted: Thu Jun 24, 2010 8:42 pm    Post subject: Re: I am having problem in Main class Reply with quote

Hi,
can you send some Code from the Main class?

Regards
Michael

--
Netbeans-Forum.de

Am 24.06.2010 um 15:58 schrieb "bharat_0007us" <address-removed>:

Quote:
Hi,

I have created a Java class with main method.

when I am running it, I am getting the following error...

java.lang.NoClassDefFoundError: Files\NetBeans
Caused by: java.lang.ClassNotFoundException: Files\NetBeans
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Files\NetBeans. Program will exit.
Exception in thread "main" Java Result: 1[/b]


Do any one have idea, who to resolve this issue?

------------------------
Nick



Back to top
jhalupka



Joined: 05 Feb 2010
Posts: 52

PostPosted: Mon Jun 28, 2010 9:09 pm    Post subject: Re: I am having problem in Main class Reply with quote

Are you running the program from NetBeans?

What is the class's package name?


bharat_0007us wrote:
Quote:

I have created a Java class with main method.

when I am running it, I am getting the following error...

java.lang.NoClassDefFoundError: Files\NetBeans
Caused by: java.lang.ClassNotFoundException: Files\NetBeans
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Files\NetBeans. Program will exit.
Exception in thread "main" Java Result: 1[/b]


--
View this message in context: http://old.nabble.com/I-am-having-problem-in-Main-class-tp28985907p29008552.html
Sent from the NetBeans - EntPack mailing list archive at Nabble.com.
Back to top
debdatta.bhattacharjee



Joined: 21 Apr 2010
Posts: 3

PostPosted: Fri Jul 15, 2011 12:31 pm    Post subject: Probable reason for: java.lang.ClassNotFoundException: Files\NetBeans Reply with quote

Well, the issue generally happens while you move one of your netbeans project from windows environment to a unix (linux or solaris) environment. In some of your project property files, still it some of the path is pointing to your windows file system.

For example, you need to refer:
(1) see project.properties file available under nbproject directory under your project directory. You must change the following parameters with proper values per your unix file system location: jaxbwiz.endorsed.dirs, jnlp.codebase.url. Also at the same point of time, remove all references of windows file system (if any) per your windows file system project and netbeans installation directory.

(2) see private.properties under nbproject/private directory, and update jaxbwiz.endorsed.dirs with the same value as mentioned above...

Hope this helps...
Back to top
Kristen Gillard
Posted via mailing list.





PostPosted: Thu Aug 18, 2011 9:35 pm    Post subject: Re: I am having problem in Main class Reply with quote

It looks from the stack trace that your installation of Netbeans could be corrupt.
Try uninstalling Netbeans and re-installing.

A Simple class:

public class Foo
{
Back to top
broncoAbierto



Joined: 21 Aug 2011
Posts: 1

PostPosted: Sun Aug 21, 2011 12:18 pm    Post subject: Possible solution for the 'Could not find the main class' error. Reply with quote

Maybe there is no main class, actually.

This could be due to NetBeans having created it automatically when you created the project, and you having deleted it afterwards. The class no longer exists but NetBeans still thinks it's the main class.

To check if that's the problem do the following:

-On the project browser, right-click on the name of your project, then click Properties. A project properties dialog should appear.
-On the left side of the dialog, click on Run.
-You'll see several text fields. One of them is labelled 'Main Class'. If there's anything in that field, delete it, and leave it blank.
-Click OK.

The next time you try to run your project, you'll be prompted to choose a main class. Do so and proceed.

Hope this helps.
Back to top
mn



Joined: 04 Oct 2011
Posts: 1

PostPosted: Tue Oct 04, 2011 10:07 pm    Post subject: Reply with quote

I was having the same problem until I checked "Use dedicated folder for storing libraries" in step 2 of starting a new application. I did this because I read another thread about a missing jar file(?). When it was reunited in the project folder the project would compile.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> SOA Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo