You’ll rarely see one-size-fits-all solutions in tech. The best technology is usually the one that solves a particular problem, and that’s the case with Node.js and Java.
Both have a lot of different uses—Java especially. I’ll just assume you want to know about using them in the server backend.
The functionality and ease of use of both solutions could be debated. The most significant factor, though, is whether you want to code a CPU or an I/O-intensive app.
So, if you want to build something requiring a lot of processing power, Java will typically handle it a lot better. Node.js has some features to help it here, but running CPU-intensive apps is not its forte.
In turn, I/O-intensive apps are much easier to pull off with Node.js. It just makes everything faster and can dramatically reduce resource spending.
The best backend for you depends on what kind of apps you intend to run.