I suspect you are going to need some more basics before you can start doing anything in a "browser".
Typically these days neither java nor C++ is used in a browser so you would need to learn something else first to get the browser to work. And browsers talk to servers so you would need to learn the basics of how to create a client server.
You can do that with both languages but in terms of learning you should start with one. Probably java. You would normally start with a framework\application like Tomcat if you would doing java but that is a rather steep curve if you don't know the basics of client server first. But there are books on it.