Java is a programming language. Java is not the same as the JavaScript programming language, even though the latter shares part of its name.
The two languages were developed separately (Java was developed by James Gosling at Sun Microsystems, while JavaScript was developed by Netscape). However, the two languages have many similarities in structure and features.
JavaScript is used to manipulate HTML code and for programming.
Java, on the other hand, is used for programming.
Both languages are open and available to everyone.