Apache Commonsの動作確認

IDEとか持ち出さずにサクッと動作確認がしたかった。

ここではApache Commons Codecを使ってみます。

公式サイトからバイナリのZIPをダウンロード。



展開して中に入ってテストコードを用意。

// test.java
import org.apache.commons.codec.digest.DigestUtils;

public class test{
   public static void main(String[] args){
     String target = DigestUtils.sha256Hex("hoge");
     System.out.println(target);
   }
}

>javac -classpath commons-codec-1.15.jar; test.java

>java -classpath commons-codec-1.15.jar; test
ecb666d778725ec97307044d642bf4d160aabb76f56c0069c71ea25b1e926825