I had no issues getting it to work.

I did find this line...
g.drawImage(im2, im.getWidth()/2, im.getHeight()/2, null);
Of a little concern. It MIGHT be possible to render the image outside of the background image, if the image sizes are just right. You should be using coordinates that are relative to the master image...
public class MergeImages {
public static void main(String[] args) {
File inner = new File("Inner.png");
File outter = new File("Outter.png");
try {
BufferedImage biInner = ImageIO.read(inner);
BufferedImage biOutter = ImageIO.read(outter);
System.out.println(biInner);
System.out.println(biOutter);
Graphics2D g = biOutter.createGraphics();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
int x = (biOutter.getWidth() - biInner.getWidth()) / 2;
int y = (biOutter.getHeight() - biInner.getHeight()) / 2;
System.out.println(x + "x" + y);
g.drawImage(biInner, x, y, null);
g.dispose();
ImageIO.write(biOutter, "PNG", new File("Outter.png"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
I'd also double check shuangwhywhy suggestion of making sure you not reading in the same file twice ... I did that some thing when testing the code :P