sun.security.pkcs11 on javafx
java, pkcs#11
Solution
Just install a 32bit JDK along side (or instead) of your 64 bit JDK, and make sure you compile and sign the JAR/COD file with the 32 bit version.
Actually it is a bug in the 64 bit version.. https://bugs.java.com/bugdatabase/view_bug;jsessionid=f1279f413fd19e3a247022d6dcca9?bug_id=7105065
I found it in the following discussions :-
http://www.java.net/node/703858
http://tai-dev.blog.co.uk/2009/11/11/are-you-seeing-the-java-lang-noclassdeffounderror-sun-security-pkcs11-sunpkcs11-error-when-signing-your-rim-blackberry-j2me-apps-7352729/
http://community.igniterealtime.org/thread/30821
Problem
I try to develop a javafx aplication that access a smartcard. I have a simple proof of concept, like this: ``` package javafxapplication7; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Label; import sun.security.pkcs11.SunPKCS11; public class SampleController implements Initializable { @FXML private Label label; @FXML private void handleButtonAction(ActionEvent event) { SunPKCS11 a = new SunPKCS11(); } @Override public void initialize(URL url, ResourceBundle rb) { // TODO } } ``` and the exepcion is: ``` Caused by: java.lang.NoClassDefFoundError: sun/security/pkcs11/SunPKCS11 at javafxapplication7.SampleController.handleButtonAction(SampleController.java:26) ```