Java and JavaScript may share part of their names, but they are quite different! Java is a general-purpose programming language used for building standalone applications, while JavaScript is mainly used for web development to make web pages interactive.
What got you interested in comparing Java with JavaScript? Are you considering learning one of them for a specific project?