Skip to content
Advertisement

gradle executable jar can’t include local jar dependencies

SOLVED

WaitingDatabase.connect(WaitingDatabase.java:17)

JavaScript

(Sorry for bad english.)

I have to connect my oracle database, so I downloaded oracle jdbc driver and added in my dependencies. It connected well when I run at intellij, so I built executable jar file with gradle.

However, it couldn’t connect to my oracle database. I think it was built without oracle jdbc driver file, because it is a local jar file.

How can I build with all of my dependencies?

If you need more information about my project to solve this problem, please let me know.

Thank you 😀


build.gradle

JavaScript

cmd

JavaScript

error message

JavaScript

WaitingDatabase.connect(WaitingDatabase.java:17)

JavaScript

file tree

JavaScript

ADDED

db.properties

JavaScript

Advertisement

Answer

What you did is correct:

JavaScript

This will also work:

JavaScript

The advantage of this is that it will include all the jars in the lib directory without you having to do it manually.

ojdbc6.jar is meant for JDK 6, as stated here. If you are using > JDK 6, you might want to consider upgrading your ojdbc6.jar and most importantly you might want to check this.

Cheers

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement