Java and JavaScript both are different even though they share similar names. Java is a programming language which is useful for desktop development, that is developing applications for desktop or mobile.
Whereas, JavaScript is a scripting language that focuses on web development specifically front-end development. So learning these two entirely depends on the purpose. If you are inclined towards web development then learn JavaScript first and then Java as it might help you in getting skillful for back-end development. And learn Java first if you are inclined towards desktop developments.
Do check out the Java certification course from Intellipaat, which includes 40hrs online instructor-led training course with 7 guided projects to practice and also comes with Lifetime 24*7 technical support.
Also, check out our YouTube video on the Difference Between Java And JavaScript from our experts to help you get started.