Oracle is database administration, and Java is a mainstream programming language. Java is the better choice if you want to be a programmer.
Oracle is in fact more than a database. They have many products including the database, development tools, application server, virtualization software, etc…but anyway, you can’t compare it to Java. They are different things.