I don't see a reason why this happens. Try to the method final
and the difference should go away. And use the latest version of Java from Oracle or IBM.
Now the reason why Java doesn't have many optimization keywords is simple: The people who invented Java didn't like how much time C developers spent to squeeze out the last drop of juice out of the compiler. That felt like a huge waste of productive time.
So the idea with Java is that you write code. You concentrate just on writing good code. The Java compiler and the runtime then make it fast. That means that the runtime analyzes the CPU and optimizes the code differently depending on what the CPU can do. This is why Java code can be faster than C++.
Of course, bad code is bad, no matter how clever the optimizer is. So you can write code which very slow but that doesn't depend on the language.