导入的jar包不存在(imported jar package does not exist)

编程入门 行业动态 更新时间:2024-10-18 14:24:52
导入的jar包不存在(imported jar package does not exist)

我正在编写一个使用base64编码字符串的类。

我下载了jar文件并以下列方式将其导入我的项目:

右键单击项目库属性 - >单击Add / Jar Folder按钮 - >导航到我想添加的jar文件 - >单击它并单击打开将其上载到库

jar已成功上传,并且在项目库中可见。 但是当我尝试使用它时,netbeans说包org.apache.commons.codec.binary.Base64。 不存在

以下是代码:

package dfqeas.online.actions.application; import org.apache.commons.codec.binary.Base64; //this is the package that netbeans says it does not exist public class encryptbank { public String encryptbank(String words){ String original = words; String Salt = "butternut"; String fullyEncoded; //encoding byte into base 64 byte[] encoded = Base64.encodeBase64(original.getBytes()); byte [] salty = Base64.encodeBase64(Salt.getBytes()); fullyEncoded = new String(encoded) + new String(salty); return fullyEncoded; } }

我刚开始学习java和Netbeans,请帮忙。

I am writing a class to encode a string using base64.

I downloaded the jar file and imported it into my project in the following way:

Right click on the project library properties -> Click on the Add/Jar Folder button -> Navigate to the jar file I wish to add -> Click on it and click open to upload it to the library

The jar was successfully uploaded and it is visible in the project library. But when I try to use it, netbeans says the package org.apache.commons.codec.binary.Base64. does not exist

The following is the code:

package dfqeas.online.actions.application; import org.apache.commons.codec.binary.Base64; //this is the package that netbeans says it does not exist public class encryptbank { public String encryptbank(String words){ String original = words; String Salt = "butternut"; String fullyEncoded; //encoding byte into base 64 byte[] encoded = Base64.encodeBase64(original.getBytes()); byte [] salty = Base64.encodeBase64(Salt.getBytes()); fullyEncoded = new String(encoded) + new String(salty); return fullyEncoded; } }

I am just starting to learn java and Netbeans, please assit.

最满意答案

尝试重新启动NetBeans 8.2 IDE。

Try restarting the NetBeans 8.2 IDE.

更多推荐

本文发布于:2023-08-06 13:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1450320.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不存在   jar   imported   exist   package

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!