Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » even after setting the classpath got java.lang.NoClassDefFoundError: org/ini4j/Ini (Even after setting the classpath in Project BuildPath->libraries I got the error at runtime.Project is under version control)
icon5.gif  even after setting the classpath got java.lang.NoClassDefFoundError: org/ini4j/Ini [message #667002] Mon, 25 April 2011 12:42 Go to next message
shankhs  is currently offline shankhs Friend
Messages: 3
Registered: October 2010
Junior Member
Hi,

I added ini4j-0.5.1.jar to the my project classpath in eclipse using Project Properties->Build Path -> Libraries ->Add external Jars. My project is under version control. I added the following code at appropriate place:
Ini ini = new Ini(new FileReader("C:\\file.ini"));

for (String key : ini.get("Symbol").keySet())
{
  System.out.println( key + " = " + ini.get("Symbol").fetch(key));
}

When I run the project now I get
java.lang.NoClassDefFoundError: org/ini4j/Ini

which I think is due to the wrong classpath, but eclipse is recognizing Ini class fine, its even suggesting the header files to import and the methods.Can anybody please tell me how to set the correct classpath also how to do that manually and which files should be changed?Is it because the project is in clearcase and some of the files which should get changed is not changed since they are not checked-out?

When I created a test project outside of clearcase, ini4j worked!
I am very confused , please help.
Thank you
Re: even after setting the classpath got java.lang.NoClassDefFoundError: org/ini4j/Ini [message #667067 is a reply to message #667002] Mon, 25 April 2011 20:23 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 4/25/11 8:42 AM, shankhs wrote:
> Hi,
>
> I added ini4j-0.5.1.jar to the my project classpath in eclipse using
> Project Properties->Build Path -> Libraries ->Add external Jars. My
> project is under version control. I added the following code at
> appropriate place:
>
> Ini ini = new Ini(new FileReader("C:\\file.ini"));
>
> for (String key : ini.get("Symbol").keySet())
> {
> System.out.println( key + " = " + ini.get("Symbol").fetch(key));
> }
> When I run the project now I get java.lang.NoClassDefFoundError:
> org/ini4j/Ini
> which I think is due to the wrong classpath, but eclipse is recognizing
> Ini class fine, its even suggesting the header files to import and the
> methods.Can anybody please tell me how to set the correct classpath also
> how to do that manually and which files should be changed?Is it because
> the project is in clearcase and some of the files which should get
> changed is not changed since they are not checked-out?

You edited the Build Path, but you have to also update the runtime
classpath of your Launch Configuration. A Launch Configuration is what
Eclipse uses to run the specific programs from your projects; in most
cases the runtime classpath of the Launch Config is automatically kept
up to date with your build path, but you may have to manually add this
JAR to yours for some reason.
Open the Run Configurations... or Debug Configurations... dialog to edit
your Launch Configurations.

Eric
Previous Topic:setting up eclipse
Next Topic:Embedded file browser plugin?
Goto Forum:
  


Current Time: Thu Apr 25 20:20:52 GMT 2024

Powered by FUDForum. Page generated in 0.08225 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top