| View previous topic :: View next topic |
| Author |
Message |
MrFredBloggs@hotmail.com Guest
|
Posted: Thu Jul 14, 2005 12:06 am Post subject: NetBeans 4.1 project runtime problem. |
|
|
Hi All,
I have a small Java project in NetBeans 4.1. The project compiles
correctly, but at runtime I get a ClassNotFoundException, even though I
have added the jar file
that the class is in to the classpath (using the NetBeans wizard).
Other classes that I have added to the project using the same method do
not give me a problem.
Any ideas as to how I can solve this.
Thanks,
Fred.
|
|
| Back to top |
|
 |
Remi Arntzen Guest
|
Posted: Thu Jul 14, 2005 12:12 am Post subject: Re: NetBeans 4.1 project runtime problem. |
|
|
When you "run" your project do you use "java [... whatever ...]" or do
you click on the play button in NetBeans4.1.
If you are useing "java -jar [...]" you have to add the classpath to
the jar's manifest file.
|
|
| Back to top |
|
 |
MrFredBloggs@hotmail.com Guest
|
Posted: Thu Jul 14, 2005 12:18 am Post subject: Re: NetBeans 4.1 project runtime problem. |
|
|
I click on the "Run Project" option of the the project's popup menu.
|
|
| Back to top |
|
 |
MrFredBloggs@hotmail.com Guest
|
Posted: Thu Jul 14, 2005 12:41 am Post subject: Re: NetBeans 4.1 project runtime problem. |
|
|
I've solved the problem. I had to add other jar files to the classpath
that are related to the "missing" class.
Thanks for your help.
Fred.
|
|
| Back to top |
|
 |
Remi Arntzen Guest
|
Posted: Thu Jul 14, 2005 12:55 am Post subject: Re: NetBeans 4.1 project runtime problem. |
|
|
hmmmm...
just to clarify; the jar file is listed in
File>"[PROJECT NAME]" Properties>Libraries tree node
under the compile tab, not the test tab's, or run tab's?
and selecting the "Run" tree node (on the left. not the tab)
you see the correct class listed in the "Main-Class:" argument. (be
certain that it is the full package name of the class.)
other than that I don't really know...
|
|
| Back to top |
|
 |
Remi Arntzen Guest
|
Posted: Thu Jul 14, 2005 1:00 am Post subject: Re: NetBeans 4.1 project runtime problem. |
|
|
X-No-Archive
opps...
| Quote: | Thanks for your help
Welcome!  |
|
|
| Back to top |
|
 |
|