title: Base64 apache.commons .encodeBase64 symbol not found
body: <p>I am working on writing an encryption class to encrypt/decrypt data with a key before/after sending TCP data.  I am having a problem getting <code>org.apache.commons.codec.binary.Base64</code> to work on my system.  In most cases, I can see people relating this to android studio, however, I'm using notepad++ and the command line and am still having problems.</p>
  
  <p>I have added <code>commons-codec-1.10.jar</code> to my project directory.  I run at the command line:</p>
  
  <pre><code>javac -cp .;commons-codec-1.10.jar Server.java ... CryptoUtil.java 
  </code></pre>
  
  <p>I have this at the top</p>
  
  <p><code>import org.apache.commons.codec.binary.Base64;</code></p>
  
  <p>My error is:</p>
  
  <pre><code>CryptoUtil.java:60: error: cannot find symbol
                 String encStr = new Base64.encodeBase64String(out);
                                           ^
      symbol: class encodeBase64String
      location: class Base64
  
  CryptoUtil.java:87: error: cannot find symbol
                  byte[] enc = new Base64.decodeBase64(encryptedText);
                                         ^
       symbol: class decodeBase64
       location: class Base64
  2 errors
  </code></pre>
  
  <p>And my enclosing functions:</p>
  
  <pre><code>    public String encrypt(String secretKey, String plainText) 
              throws NoSuchAlgorithmException, 
              InvalidKeySpecException, 
              NoSuchPaddingException, 
              InvalidKeyException,
              InvalidAlgorithmParameterException, 
              UnsupportedEncodingException, 
              IllegalBlockSizeException, 
              BadPaddingException{
          //Key generation for enc and desc
          KeySpec keySpec = new PBEKeySpec(secretKey.toCharArray(), salt, iterationCount);
          SecretKey key = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(keySpec);        
           // Prepare the parameter to the ciphers
          AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);
  
          //Enc process
          ecipher = Cipher.getInstance(key.getAlgorithm());
          ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);      
          String charSet="UTF-8";       
          byte[] in = plainText.getBytes(charSet);
          byte[] out = ecipher.doFinal(in);
          String encStr = new Base64.encodeBase64String(out);
  
          return encStr;
      }
  
       public String decrypt(String secretKey, String encryptedText)
       throws NoSuchAlgorithmException, 
              InvalidKeySpecException, 
              NoSuchPaddingException, 
              InvalidKeyException,
              InvalidAlgorithmParameterException, 
              UnsupportedEncodingException, 
              IllegalBlockSizeException, 
              BadPaddingException, 
              IOException{
           //Key generation for enc and desc
          KeySpec keySpec = new PBEKeySpec(secretKey.toCharArray(), salt, iterationCount);
          SecretKey key = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(keySpec);        
           // Prepare the parameter to the ciphers
          AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);
          //Decryption process; same key will be used for decr
          dcipher=Cipher.getInstance(key.getAlgorithm());
          dcipher.init(Cipher.DECRYPT_MODE, key,paramSpec);
          byte[] enc = new Base64.decodeBase64(encryptedText);
          byte[] utf8 = dcipher.doFinal(enc);
          String charSet="UTF-8";     
          String plainStr = new String(utf8, charSet);
          return plainStr;
      }    
  </code></pre>