imported jar package does not exist

回眸只為那壹抹淺笑 提交于 2020-02-05 08:12:05

问题


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.


回答1:


Try restarting the NetBeans 8.2 IDE.



来源:https://stackoverflow.com/questions/28393206/imported-jar-package-does-not-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!