Answer the question
In order to leave comments, you need to log in
[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:
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
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 questionAsk a Question
731 491 924 answers to any question