Issue
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.
Solution
Try restarting the NetBeans 8.2 IDE.
Answered By - RMichalowski