Java bytecode files are not only portable and well designed but specifically organized with tables of names (so that the bytecode proper can concisely refer to names by index).

The inconvenience of handling a binary format should be much smaller than the challenge of parsing C++ sources to find names.