Java isn't worse than C++; it has a much more capable run-time, something which is left as an implementation-defined footnote in C++.
Java had a leg-up over C++ by several decades in having a concurrency story (at all) in the language.
I wouldn't use std:: anything for threads even in a greenfield C++ project today.
Garbage collection is more advanced than the primitive management tools available in C++, like smart pointers to reference counted or exclusively owned objects: those approaches are strictly worse than the correct, gold-standard solution to the object lifetime problem.
> Java isn't worse than C++;
"Worse is better" is about simplicity vs expressibility tradeoffs, not an absolute better/worse value judgement. By saying Java is worse than C++ here the OP is only saying that Java is simpler (less expressible) than C++.
> Java had a leg-up over C++ by several decades in having a concurrency story (at all) in the language.
While sort of technically true, concurrent code expressed in high level language was almost invented in C in the 1980's as the first Unix SMP devices took off (early multiprocessing work at the OS level was at the assembly level, Unix was almost alone in having a portable kernel and the need for SMP).
Java, coming along about a decade later from the same incubation environment, very much reflects that learning. But no, they did it right in Java because they had already done it in C.
It's hard to look at Java and not see it as a transitional language now. Electron, Node, and even .Net have fundamentally been more successful implementing ideas that first saw widespread adoption in Java. JSON is basically XML, which is what Java pushed so hard for for data exchange instead of really gross binary serialization formats.
Although, Java wasn't really trying to compete with C++ everywhere. It's just that, at the time, C++ was used at all levels. I mean, this was a time when it was C++, Visual Basic, or Turbo Pascal/Delphi for application programming. You couldn't easily get more abstract than that. That's wildly unlike today's landscape.