Both are good languages to be associated with and both of them cater to different needs. Java is an object-oriented programming language for developing applications for Desktop and mobile platforms. Whereas, JavaScript is a well-established scripting language used for Web development. Both of them are highly sought-after languages, so choosing anyone comes in line with your profession or field of interest.
Want to get certified by learning Java? Then check out the Java certification course from Intellipaat is a 40hrs online course that includes 7 guided projects to gain the required hands-on experience.
Also, do take a look at our YouTube video on Java vs JavaScript to help you get started.