Why not make a simple padding function? I know there are libraries, but this is a very simple task.
System.out.println(padStr(123, "0", 8));
System.out.println(padStr(1234, "0", 8));
System.out.println(padStr(123456, "0", 8));
System.out.println(padStr(12345678, "0", 8));
public String padStr(int val, String pad, int len) {
String str = Integer.toString(val);
while (str.length() < len)
str = pad + str;
return str;
}