title: JAVA Converting Hexadecimal String
body: <p>In Python, I can convert hex to something like this.. </p>
  
  <pre><code>s = "6025ce2069c61b15d8314f7cdd76b850dcd339547335d0e4a1e0b9915b0230cd"
  
  s.decode('hex')
  '`%\xce i\xc6\x1b\x15\xd81O|\xddv\xb8P\xdc\xd39Ts5\xd0\xe4\xa1\xe0\xb9\x91[\x020\xcd'
  </code></pre>
  
  <p>My question is how to do the same thing in Java?</p>
  
  <p>I did this in Java like this but it raises an exception. </p>
  
  <pre><code>new String(Hex.decodeHex(str.toCharArray()), "UTF-8"
  </code></pre>
  
  <p>The error messege is like this. </p>
  
  <pre><code>Exception in thread "main" org.apache.commons.codec.DecoderException: Odd number of characters.
  </code></pre>
  
  <p>========================================================</p>
  
  <p>I removed UTF-8 but I am still getting the same exception.. please help!</p>
  
  <pre><code>new String(Hex.decodeHex(combined.toCharArray()))
  
  Exception in thread "main" org.apache.commons.codec.DecoderException: Odd number of characters.
  </code></pre>