dcsimg
ClassNotFoundException when i export a Jar executable file from Eclipse 3.2 and try to execute it.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, August 18, 2006 06:45 AM

Hi all, I need that someone helps me to find some tutorial where i can learn about the way of adding libraries into my project so that when i export the project as *.jar executable and execute it, the error ClassNotFoundException doesn't appear. I am using Eclipse 3.2 (SDK) IDE. I have a Java Project that requires a Oracles' library (oracle9.jar) in order that it works. I have tried the following: I have created a new folder into the directory of my project called "lib". Then, I have imported (from the FileSystem) the library "oracle9.jar". One done this, I have gone to my project's properties and then I have gone to the   More>>

Hi all,


I need that someone helps me to find some tutorial where i can learn about the way of adding libraries into my project so that when i export the project as *.jar executable and execute it, the error ClassNotFoundException doesn't appear.



I am using Eclipse 3.2 (SDK) IDE. I have a Java Project that requires a Oracles' library (oracle9.jar) in order that it works.



I have tried the following:



  • I have created a new folder into the directory of my project called "lib".


  • Then, I have imported (from the FileSystem) the library "oracle9.jar".


  • One done this, I have gone to my project's properties and then I have gone to the Java Build Path propierty. Once there, I have opened the tab called "Libraries" and I have added the library using the "Add Jars" button.



  • If I export the project as an executable jar at this point and I execute the jar file, when the application tries to find the Oracle's driver returns a ClassNotFoundException exception.


  • Then, I have tried to add the oracle's jar library into the Source tab and in the tab "Order and Export" (into the project properties), but the result is the same. It returns the same exception...



Please, somebody can recommend some document to me that explains how to do this correctly?


THANKS A LOT IN ADVANCE!

Dan    <<Less

Re: ClassNotFoundException when i export a Jar executable file from Eclipse 3.2 and try to execute it.

Posted By:   Anonymous  
Posted On:   Friday, August 18, 2006 11:12 AM

"Order and Export" won't add the jar into your jar - Checking Export in that tab means that when you add that project to the build path of another project those libraries will also be added.

The correct way to do this is add oracle9.jar to your classpath. IMHO you shouldn't try to package the oracle classes with yours or you will have trouble upgrading one without the other. If you need to package a distribution - zip all your jars up together or use Java Web Start
About | Sitemap | Contact