java.lang.NoClassDefFoundError: org/spongycastle/util/encoders/Hex in Java when dealing with Bitcoin addresses I have a private key bigInt of type bigInteger and I would like to generate the address corresponding to this private key. I implemented the following function

public String get_address () {
Address address = new Address(NetworkParameters.prodNet(), Utils.sha256hash160(new ECKey(bigInt).getPubKey()));
return address.toString();
}


When compiling, I have

Exception in thread "main" java.lang.NoClassDefFoundError: org/spongycastle/util/encoders/Hex
at com.google.bitcoin.core.NetworkParameters.&lt;clinit&gt;(NetworkParameters.java:49)
at bitcoin.get_address(bitcoin.java:40)
at main.main(main.java:11)
Caused by: java.lang.ClassNotFoundException: org.spongycastle.util.encoders.Hex
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more


I guess that I need to import the library org.spongycastle but I don't know how to do that in Eclipse.

Who can help me with this?

Thanks a lot.
You need to resolve the dependency org.spongycastle.util.encoders.Hex, more than likely you need to add this dependency to your pom.xml file if you are using Maven. If you are not using maven, you will have download the JAR file from somewhere and I add it to your build path in Eclipse. 

From a quick Google search this appears this is  the dependency that you want.