/usr/lib/ error on Debian Wheezy


this should have been fixed by



I came across this error the other day running a java application on Debian Wheezy: Could not initialize NSS
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at Method)
at jd.http.XTrustProvider.install(
at jd.http.Browser.init(
at jd.update.Main.main(
Caused by: /usr/lib/
… 18 more
ERROR Could not initialize NSS

Apparently an update broke the configuration of the OpenJDK installation. So to fix it I had to manually edit the file /etc/java-6-openjdk/security/nss.cfg:

name = NSS
#nssLibraryDirectory = /usr/lib
nssLibraryDirectory = /usr/lib/i386-linux-gnu
nssDbMode = noDb
attributes = compatibility

Commenting out the highlighted orange line and adding the highlighted green line. The reason of it is that OpenJDK has split this configuration according to the box architecture (see However on my box it failed updating the reference to the new location of the file (I am on Debian Wheezy which is not stable yet so I guess something went wrong).

16 Responses to “ /usr/lib/ error on Debian Wheezy”

  1. Andrés Reyes D. says:

    HEY! Be careful,
    x64 users must specify /usr/lib/x86_64-linux-gnu directory on nss.cfg file.

    name = NSS
    nssLibraryDirectory = /usr/lib/x86_64-linux-gnu
    nssDbMode = noDb
    attributes = compatibility

    Now JDownloader works great on my Debian (Wheezy).


  2. Leandro Del Teso says:

    Exactly Andrés. The path is architecture-dependant….so each one has to find the right path according to the current configuration of the box. One easy way to do this is by running:


    Anyway, I guess the package should get fixed soon and this will be fixed automatically when updating.

  3. Excellent — I had reluctantly switched back to sun jdk when this broke, but now I can go back. Thanks.

  4. dwaver says:

    dude you saved my day!

    … i will now disable auto updates in debian… because i can not stand fixing other people’s software problems. (releasing things untested?) (no test documentation?)

    i am using eclipse on debian wheezy inside a xen vm connecting via vnc.

    but snapshots don’t work right now… so i could not even restore a working version of debian/openjdk.
    thanks again.

  5. Leandro Del Teso says:

    Well, Wheezy is the current Debian’s testing branch so expect it to have this sort of odd behavior occasionally.

    Maybe you should go for Squeeze which is Debian’s stable release. You won’t experience this “broken” updates on stable, for sure. :)

  6. buwil1 says:

    thanks a lot, saved my day too, never would have figured this out myself…

  7. Sean says:

    Wow, thanks for posting this. I was running into this exact problem today and I was wondering what I changed in my code.

  8. andre says:

    thanks to thread and first comment :) now running jd on my wheezy 64 bit :))

  9. [...] buscando me encontré con la respuesta gracias a este genial post y que básicamente hay que hacer lo [...]

  10. Korsaire says:

    Thanks, it runs right now.

  11. Thanks for the post :)

  12. [...] gedit /etc/java-6-openjdk/security/nss.cfgand changed its content into the following (thanks to /usr/lib/ error on Debian Wheezy):name = NSS nssLibraryDirectory = /usr/lib/x86_64-linux-gnu nssDbMode = noDb attributes = [...]

  13. Diego Santiviago says:

    It works! I’m using x86_x64 configuration.

    name = NSS
    nssLibraryDirectory = /usr/lib/x86_64-linux-gnu
    nssDbMode = noDb
    attributes = compatibility

  14. Adil says:

    It works. This help resolve bug on CCS (Eclipse) plugin install on Ubuntu. Error was: Could not initialize NSS.

  15. [...] I am a lazy guy, I checked Google for an answer which you can find here. I had to make just a little change cause I use a x64 [...]

  16. FGM says:

    After tweaking this file, your tip helped me make it work.

    The nssLibraryDirectory was set to the in Zend Studio instead of pointing to a directory.

    Being on Ubuntu 11.04, /usr/lib/x86_64-linux-gnu did not contain that file either, but is present in /usr/lib, and setting

    nssLibraryDirectory = /usr/lib

    dit the trick.

Leave a Reply