OAuth(client credentials) Return 400

String encodeData =
new String(Base64.encodeBase64((clientId+":"+clientSecret).getBytes("ISO-8859-1")));

HttpClient client = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("https://login.mypurecloud.jp/oauth/token");
httpPost.addHeader("Authorization", " Basic " + encodeData);
httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");
httpPost.addHeader("grant_type", "client_credentials");
HttpResponse response = client.execute(httpPost);

It returns 400, is there anything wrong with my code?

Sorry,it has been solved.

Glad you got your issue resolved. For future reference, there are several code examples for how to base64 encode your client ID and secret: https://developer.mypurecloud.com/api/rest/authorization/base-64-encoding.html