To start with, these are arguably two of the best programming languages of all time. They are also at the top of the list of the most popular languages in the tech world. As much as C and C++ are the grand parents of modern object oriented programming languages, Java has been very successful since its release more 10 years after the release of C++. Java's notion of _write once, run anywhere _was its selling point. Java came to displace C++ in terms of memory management, simplicity, and other critical aspects that programmers didn't like. It was a huge success.
The two languages have their areas of strengths. C++ was originally meant to replace C by introducing classes and making it properly object oriented modeled after Simula. It was intended for system-level programming and also for large systems with high processing power (Just take a look at MySQL, that is C/C++ in action). Java, on the other hand, was designed for internet applications originally. It became a huge success as it could be written in one platform and have it run in another that has the Java Virtual Machine (JVM). In other words, the emergence of the internet made Java a go-to language in mid/late 90s.
Having said all that, any programmer will agree with me that these two languages are fundamental to the successes we have recorded till date in the software world. So I see these languages still in high demand in 2018. However, in the mobile software space, especially Android, Java will have Kotlin as a very strong contender in 2018. But the good news is that this language mixes well with Java and also runs on JVM. Many developers have been favoring Kotlin over Java for android development for obvious reasons. The language has removed some painful aspects of Java such as the dreaded NullPointerException, so say bye-bye to NPE in Kotlin. But in the enterprise/server side programming, Java technology is still a big contender with other big names like .Net/C# or PHP. So many enterprise platforms run on Java, so 2018 will still see a large demand for Java developers.
On the question of choice, I think it depends on your niche and the type of project you are working on. I would favor Java over C++ in 2018 because I do a lot of mobile and web development. Another programmer who designs embedded systems or one who develops gaming applications would definitely go for C++ in 2018.
Which ever of these languages we decide to pick up for our next project, let us focus on the best practices in those languages so as to deliver another great app or system for the world. Let's also not forget a plethora of new generation languages and frameworks out there that can be mixed with these languages (Java/C++) for faster delivery of projects.
In conclusion, all programming languages have their strong areas. So one of the best decisions any software engineer or programmer can make at the start of a project is determining the language/technology or a mix of those that would be most appropriate for achieving the task at hand. Once this decision is taken care of, the rest is implementation.