I
I
Igor Petrov2011-05-02 22:20:15
Java
Igor Petrov, 2011-05-02 22:20:15

[SOLVED] NoClassDefFoundError crashes when launching a jar file while working with a database?

Hi all!
I ran into a problem that my jar file does not want to run. Compiled in JDeveloper.
The error looks like this:
7515fbd5.jpg
Obviously, due to the curvature, the JDBC driver is not added to the archive.
I compile as follows:
Project Properties => Deployment => New… => JAR File => [specify Main Class]; [In Library Dependies there is a tick on Oracle JDBC]
Then I compile according to the given scheme. Compiles without errors. The program works in the IDE itself.
I apologize for such nonsense, but Google could not answer me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Petrov, 2011-05-03
@KriegeR

If anyone needs it, I'll write here the solution to the problem.
Method number 1. Download the JDBC driver separately (at the time of this writing, this is ojdbc14.jar). We brutally transfer the contents of the driver to your * .jar file. If you do not need everything, as in my case, then you can try to copy only the files you need, while not violating the directory structure.
Method number 2. Use the import in the IDE itself to add the necessary files to the project. In the “Deploy...” settings, do not forget to specify that the original classpasses and files be saved in full during compilation.
- Surely there is also a method number 3, and number 4, but I did not find them. Basically, that's how it works.
Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question