Java is an object-oriented programming language and have virtual machine platform that allows you to create compiled programs that run on nearly every platform whereas JavaScript is a scripting language that helps you create interactive web pages.
You should consider Java if your project involves…
Android Apps
Enterprise Software
Scientific Computing
Big Data Analytics
General Purpose Programming of Hardware
You should consider JavaScript if your project involves…
Dynamic single page applications (SPAs)
Front-End technologies like jQuery, AngularJS, Backbone.js, Ember.js, ReactJS etc.
Mobile App Development through PhoneGap, React Native, etc.
Purvi Barot
Java is an object-oriented programming language and have virtual machine platform that allows you to create compiled programs that run on nearly every platform whereas JavaScript is a scripting language that helps you create interactive web pages.