Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Classpath entry will not be exported or published. Runtime ClassNotFoundExceptions may result.(Ignoring that warning, I am getting ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver )
icon5.gif  Classpath entry will not be exported or published. Runtime ClassNotFoundExceptions may result. [message #772188] Thu, 29 December 2011 07:51 Go to next message
vasudev yadav is currently offline vasudev yadavFriend
Messages: 3
Registered: December 2011
Junior Member
hello Smile
Trying to connect to DB2.
I got connection in Data Source Explorer.

But the following code is not working Crying or Very Sad

Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
java.sql.Connection cn = DriverManager.getConnection("string");


Exception generated is:
java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

So I added db2java.jar within user library under the java resources.
validating the project I am getting warning
Classpath entry ...../db2java.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. Rolling Eyes

Ignoring that warning, I am getting ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

So I guess the problem is that I am not able to include the jar files effectively...
Thanks Smile
I tried to add new path variable also but the warning generated is same as above..
Re: Classpath entry will not be exported or published. Runtime ClassNotFoundExceptions may result. [message #772970 is a reply to message #772188] Sat, 31 December 2011 03:58 Go to previous messageGo to next message
vasudev yadav is currently offline vasudev yadavFriend
Messages: 3
Registered: December 2011
Junior Member
Found a work arround...

"Run -> Run Configurations -> Classpath (tab) -> Add External Jars"

adding the required jar over here solves the problem, but
don't know if it is a correct approach.
Re: Classpath entry will not be exported or published. Runtime ClassNotFoundExceptions may result. [message #773645 is a reply to message #772970] Mon, 02 January 2012 06:58 Go to previous message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
I am assuming you have configured your Connectivity driver definition already.

Quote:
So I added db2java.jar within user library under the java resources.


I don't understand what you meant by this. But when I added the driver jar via a user library, it did work for me. The recommended approach, though, is to add the library to the project as a connectivity driver definition, which is available in the "Add Library" wizard.
Previous Topic:how to find a sibling node in Eclipse AST
Next Topic:Help regarding image manipulation using eclipse plugin
Goto Forum:
  


Current Time: Fri Mar 29 02:40:01 GMT 2024

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

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

Back to the top