简体   繁体   中英

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.

I have developed a small project based javafx application.
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 .
My project runs well at Netbean without warning or error. But When I build this project as jar file, following error is occurred:

**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.

More information on this : Package com.sun.org.apache.xml.internal.security.utils.Base64 does not exist

To resolve your problem, you should use some other library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM