[英]How to solve com.sun.org.apache.xml.internal.security package does not exist in netbean javafx application
I want to build .jar in NetBean 8.0.2.我想在 NetBean 8.0.2 中构建 .jar。
I have developed a small project based javafx application.我开发了一个基于 javafx 应用程序的小项目。
My project uses packages such as com.sun.org.apache.xml.internal.security
, com.sun.org.apache.xml.internal.security.c14n
and com.sun.org.apache.xml.internal.security.utils
.我的项目使用诸如
com.sun.org.apache.xml.internal.security
、 com.sun.org.apache.xml.internal.security.c14n
和com.sun.org.apache.xml.internal.security.utils
。
My project runs well at Netbean without warning or error.我的项目在 Netbean 上运行良好,没有警告或错误。 But When I build this project as jar file, following error is occurred:
但是当我将此项目构建为 jar 文件时,出现以下错误:
**error: package com.sun.org.apache.xml.internal.security does not exist**
**error: package com.sun.org.apache.xml.internal.security.c14n does not exist**
**error: package com.sun.org.apache.xml.internal.security.utils does not exist**
How to solve this problem?如何解决这个问题呢?
如果您的项目使用Maven ,请将 Maven 依赖项com.sun.xml.security:xml-security-impl:1.0
添加到您的 Maven 项目文件 ( pom.xml
)。
您必须将xml-security-impl.jar
到您的类路径中。
下载 xmlsec-xyzjar(例如 xmlsec-1.4.0.jar)并将其添加到项目库中,解决了该问题。
You have used a package which should not be used.您使用了不应使用的软件包。 It has already been clarified here on SO and many places that any class within package starting from
com.sun
must not be used, as they can be removed in later versions of Java, without replacement.已经在 SO 和许多地方澄清了从
com.sun
开始的包中的任何类都不能使用,因为它们可以在 Java 的更高版本中删除,无需替换。
More information on this : Package com.sun.org.apache.xml.internal.security.utils.Base64 does not exist关于此的更多信息: 包 com.sun.org.apache.xml.internal.security.utils.Base64 不存在
To resolve your problem, you should use some other library.要解决您的问题,您应该使用其他一些库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.