I'm looking for a program or web service that can convert Java code into C++ code (preferably some human-readable C++ code). Any license, OS or price is fine.
Firstly, when it comes to conversion from language 'X' to language 'Y', then no program can beat human intentions/efforts.
For the above case Java to C++ conversion can be done using programs such as TanglibleSoftware. But for some language constructs which are only supported in Java but not in C++, some work around is surely needed.
Consider case: User 'A' hands over his source code to program 'ABCD' for conversion from language 'X' to 'Y', and he assumes to get the result(exact converted code with same behavior) in bare minimal efforts, then user 'A' is calling for a failure.
I will not go into syntactic differences between Java & C++, but if one has a good grasp on programming then for unsupported constructs of language 'X', code can always be written to perform those operations in language 'Y' successfully.
Machines can only understand code, but meaning has to be construed by Humans.
But this may not be constrained if we consider artificial intelligence into this context or some 'xyz' technology in near future.
My answer is based on my experience, I am not affiliated to TanglibleSoftware by any means, the above software worked for me, with some efforts made. It might not have worked for some other users.
Java and C++ are too different for that to be possible:
Java (and the JVM) requires a garbage collector. Which deals with circular references.
C++ requires manual memory management. Even smart pointers (with reference counters) won't usually deal easily with circular references.
C++ wants the rule of five to be respected. That rule has no simple equivalent in Java (or the JVM).
Java object model requires a single class for every object, and the class is a Java object. A C++ class is not a C++ object. C++ allows multiple-inheritance.
Java is multi-threaded. C++ knows thread only since C++11.
Java requires a dynamic class loader (so the code can be extended at runtime). In standard C++ the code is defined at compile time. POSIX has
dlsymto load more code. See also the C++ dlopen minihowto on Linux.
Java is often garbage collecting unreachable code. This is not easily feasible in standard C++.
Some experimental JVM implementations may be improved to generate (compile to) unreadable C code.
On many OSes (including Linux) you could use inter-process communication techniques between your JVM process and some process running C++ code.
Many JVM implementations are coded in C++.