如何使rijndael(php)算法适应aes(java)

I have a php code that encrypts a plain text using rijndael algorithm in the EBC mode, and a 17-charachter key length. I'm looking to use an equivalent AES algorithm with Java

This is my php code:

<?php 
  $key=" 4288f0b8060ca1b "; 
  $mcryptAlgo= MCRYPT_RIJNDAEL_128 ; 
  $mcryptMode= MCRYPT_MODE_ECB ; 
  $data = "text_to_crypt_with_aes" ;

  $mcryptedData = mcrypt_encrypt ($mcryptAlgo, $key, $data, $mcryptMode); 
  $parametres_chiffres = urlencode( base64_encode ($mcryptedData)); 
  echo($parametres_chiffres);
?> 

It returns as a result the encrypted message: 4LepwOstJA0R2bg5FrdQXeoxesxmKV4pkf514F3VDqU%3D

However, the following Java code that I've built doesn't return the same message:

public static void main(String[] args) {

        StringBuilder sb = new StringBuilder();
        sb.append("text_to_crypt_with_aes");
        String clearText = sb.toString();
        StringBuilder sbKey = new StringBuilder(" 4288f0b8060ca1b ");
        for (int i = 0; i < 7; i++) {
            sbKey.append("\0");
        }

        try {

            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");

            Key key = new SecretKeySpec(sbKey.toString().getBytes("UTF-8"),
                    "AES");

            cipher.init(Cipher.ENCRYPT_MODE, key);
            byte[] encryptedMessageInBytes = cipher.doFinal(clearText
                    .getBytes("UTF-8"));
            byte[] b64 = Base64.encodeBase64(encryptedMessageInBytes);
            String scrambled_text = new String(b64, Charset.forName("US-ASCII"));
            System.out.println(scrambled_text);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

It returns actually: 4LepwOstJA0R2bg5FrdQXRutIOZlJi06f0D8NnnIG5Q=

How can I adapt my Java code to return exactly the same as in php ?

The first 16 bytes are the same in both decryptions. The differences are in the last 16 bytes:

4LepwOstJA0R2bg5FrdQX eoxesxmKV4pkf514F3VDqU %3D
4LepwOstJA0R2bg5FrdQX RutIOZlJi06f0D8NnnIG5Q =

Since you are using ECB mode (don't, it is insecure) that tells me that you are encrypting the first block correctly and the second block is different. Your Java code specifies PKCS5 padding. PHP however uses zero padding to fill up the last block. The comments of mcrypt_encrypt contain examples to perform PKCS#7 padding, which is identical to PKCS#5 padding.