problem using external jar as library

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem using external jar as library

Nikolas Nikou
I have a project where I also use some external jars.
I created a library and placed these jars in there.

Using Project Properties I placed this library under Libraries  
Category both under Compile tab and under Run tab.
Compiling works ok but when trying to run the project
try {
       Class.forName("com.telehorizon.sql.Condition").newInstance();
     }catch(Exception e) { ...

I get

java.lang.InstantiationException: com.telehorizon.sql.Condition
         at java.lang.Class.newInstance0(Class.java:293)
         at java.lang.Class.newInstance(Class.java:261)
         at  
com.telehorizon.QM.QMConsole.LaunchQMConsole.registerTheDriver
(LaunchQMConsole.java:116)
         at  
com.telehorizon.QM.QMConsole.LaunchQMConsole.establishDBConnection
(LaunchQMConsole.java:137)
         at com.telehorizon.QM.QMConsole.LaunchQMConsole.init
(LaunchQMConsole.java:95)
         at com.telehorizon.QM.QMConsole.LaunchQMConsole.start
(LaunchQMConsole.java:52)
         at com.telehorizon.QM.QMConsole.LaunchQMConsole.main
(LaunchQMConsole.java:290)
Java Result: 1

I even placed under Run Category in VM options
-cp ../lib/QMCommon.jar ...

The path for all the jars I am using but this doesn't seem to help  
either.

Can anyone help

Nikolas