GDAX Java Bad Request
Can you try to add/modify with the with the following lines of codes in your methods:


private static JsonObject getAuthenticatedData() {

  String timestamp = Instant.now().getEpochSecond() + "";
  String accessSign = getAccess(timestamp);


  con.setRequestProperty("CB-ACCESS-TIMESTAMP", timestamp);
  con.setRequestProperty("accept", "application/json");
}



public static String getAccess(String timestamp) {

  String prehash = timestamp+"GET"+"/accounts";
  byte[] secretDecoded = Base64.getDecoder().decode(secret);
  SecretKeySpec secret_key = new SecretKeySpec(secretDecoded, "HmacSHA256");

  hash = Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(prehash.getBytes()));

  return hash;
}