我尝试开发一个访问智能卡的 javafx 应用程序。
我有一个简单的概念证明,如下所示:
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
}
}
并且执行是:
Caused by: java.lang.NoClassDefFoundError: sun/security/pkcs11/SunPKCS11
at javafxapplication7.SampleController.handleButtonAction(SampleController.java:26)