You are not logged in.

#1 2015-07-15 19:10:28

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

How to install something in a symlinked directory?

I try to update mysql-jdbc, as the example in the Wiki didn't work, I got

Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

This is probably due to the fact that the location where the jar was installed by pacman (/usr/share/java/mysql-jdbc) wasn't included in the class path.

Instead of asking every single user to tamper with their class paths, I decided to do what the Wiki suggests and try to install the jar into JRE's lib/ext directory. However, in current Arch Linux, multiple Java runtimes can be installed next to eachother. So I decided to install the jar into /usr/lib/jvm/default/jre/lib/ext, so at least the current Java version contains the binary.

However, this didn't work as expected, as default is a symlink to one of the Java engines and pacman complains:

error: failed to commit transaction (conflicting files)
mysql-jdbc: /usr/lib/jvm/default exists in filesystem

How to circumvent this issue? Or is there a better location to install such a library file?

Offline

#2 2015-07-15 23:20:57

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: How to install something in a symlinked directory?

On further investigation, it seems that all JDBC drivers install their jar files in /usr/share/java/$pkgname, which is strange, as those directories are not scanned for libraries, so Java applications can't access them out of the box.

Offline

Board footer

Powered by FluxBB