There is the decent comparison between C++ and Java:
https://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B
The question "why entreprises prefer java over C++" is not correctly formulated.
The target audience for these languages are different.
C++ suites the primary goal of companies that want to create software that requires very high speed performance , needs to interact directly with the hardware\CPU\GPU. So software like Adobe Phothoshop \ high speed games interatcing directly with graphics cards, device drivers, operating systems, web-browsers are examples. Very few companies need this kind of system level functionality. Most enterprises are writing user facing applications, web applications, mobile applications where extreme high-speed is not the requirement.
Java suites the primary goal for enterprises when writing such code is
1) Portability of code- The code should work on different operating systems witouth having to rewrite custom code. Thus saving time and money on app development. JVMs and the intermediate byte-code helps to meet this requirement.
2) Rapid application development: Java avoids the developers from having to do one the most complex peices of writing code viz using pointers and memory managent by entriley removing these features and shifting them to the JVM\garbage collector (C++ has autoptr but most developers can misuse it since the language doesnot enforce the use of malloc\new \ delete etc).
The fact that the Java JVM itself is wriiten in C\C++ , it would be incorrect to say that enterprises prefer Java over C++. They are inherently running on top of code originally written in C++ and got compiled to machine code.