Java, an object-oriented programming language, is used to create a wide range of computer and web software, while JavaScript is a scripting language that is primarily used to alter and enhance the appearance or behavior of web pages and web-based applications that run in a browser. Both languages are influenced by C and C++.

Comparison chart

Java versus JavaScript comparison chart
Edit this comparison chartJavaJavaScript
Designed by James Gosling and Sun Microsystems Brendan Eich
Major Implementations OpenJDK, many others Netscape
Typing Discipline Static, strong, safe, nominative, manifest dynamic, weak, duck
Appeared in 1995 1995; 18 years ago
Influenced by Ada 83, C++, C#, Eiffel, Generic Java, Mesa, Modula-3, Oberon, Objective-C, UCSD Pascal, Smalltalk C, Java, Perl, Python, Scheme, Self
Influenced Ada 2005, BeanShell, C#, Clojure, D, ECMAScript, Groovy, J#, Javascript, PHP, Python, Scala, Seed7, Vala ActionScript, CoffeeScript, Dart, JScript .NET, Objective-J, QML, TIScript, TypeScript
code compiled to bytecode Codes are all in text, does not need to be compiled
Statement terminators ; Semicolon terminated
Runs on Virtual machine web-browser
Stable release Java Standard Edition 8 (1.8) / March 18, 2014 1.8.5 (March 22, 2011; 2 years ago)
Introduction (from Wikipedia) Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. JavaScript is an interpreted computer programming language.


As an advanced programming language, Java powers many applications, both big and small, from apps on an Android or iPhone, to Blu-Ray players, to games like Minecraft.

JavaScript is best known for its use in web design. Most often, it is the language behind subtle graphical animations, very simple games, creative transitions, and alert messages on a webpage. JavaScript is also used to call other scripts from around the web, such as an advertising script from Google or a social media "widget" from Twitter or Facebook.

For Websites

JavaScript is commonly found in "front-end" applications, i.e., the web pages delivered to users' browsers. With node.js, JavaScript can also be used to build "back-end" or server-side applications.

Conversely, Java is more commonly used for back-end, server-side processing. Java applets may be used for browser-based apps, but they require a Java plugin and cannot run natively in web browsers.

For Desktop Applications

Beginning in the late 1990s, Java was the programming language of choice for desktop applications because it offered cross-platform support. This means application developers could write their programs in Java and they would run on Windows, Mac, and Linux desktops without needing any changes.

Mobile Applications

Native Android apps are written in Java, and older smartphone platforms like Symbian and Bada also support Java. Mobile apps can also be written in JavaScript, but there are usually a few limitations:

The potential advantage of using JavaScript for mobile apps is being able to reuse a greater percentage of the code base across mobile platforms.

Embedded Systems

Java is a mature, stable technology platform and can often be found in embedded systems, usually running on an underlying Linux OS.


Because Java and JavaScript have extensive documentation and active online communities, learning either language should be free and relatively straightforward. Still, Java has a steep learning curve, while JavaScript will likely seem easier to start with because of how it functions in a web browser. If you want to build applications, you should learn Java. If you want to make websites, you should learn JavaScript.

You can begin learning Java for free with the website Learn Java. This video also offers a brief tutorial on Java:

Codecademy offers free walkthrough tutorials for JavaScript and one of its most popular libraries, jQuery.

The following is a JavaScript tutorial video:


Java's syntax is similar to C and C++'s. It has no global variables or functions. Code is contained in classes, and values are objects.

The following code prints—displays—the words "Hello, World!" on a webpage.

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); // Display hello.

JavaScript's syntax is also influenced by C, and naming conventions are similar to those found in Java.

The following code displays a dialogue box with the words "Hello, World!" inside it.

   alert('Hello, World!');

Popular Frameworks and Libraries

In modern design and development, Java and JavaScript are often "filtered" through frameworks and libraries, which are development tools that simplify programming. The difference between a framework and a library is contested, with the terms sometimes used interchangeably, but the easiest way to differentiate the two is to know that a framework provides a "skeleton" system to work from, while a library provides specific tools to build upon a system.

Some of Java's most popular frameworks include Spring MVC, JSF, Struts, GWT, and Play.

JavaScript has a number of popular libraries, including jQuery and jQuery UI, Prototype, Mootools, and Node.js.

Java vs JavaScript popularity

In a way both Java and JavaScript promise multi-platform support — Java because its JVM is available for a lot of operating systems, and JavaScript because web browsers are available to users of all operating systems. So it is no surprise that both JavaScript and Java are very popular among developers.

Nevertheless JavaScript has seen a surge in popularity over the last 5 years.

New Github repositories by programming language, based on analysis by Donnie Berkholz.
New Github repositories by programming language, based on analysis by Donnie Berkholz.


For users, all modern operating systems support Java (usually through Oracle), and all modern browsers support JavaScript. For web developers, creating scripts in JavaScript will be straightforward, while creating online Java applications will be trickier, and not only because of the difficult nature of the language itself. Few shared web hosts will host Java applications due to how much memory they tend to use on a server. Because of this downside to Java, other languages, like PHP, Ruby and Python, continue to be more popular for web development purposes, even though they are often slower in other ways.


As languages, neither Java nor JavaScript is inherently open source, but many implementations, or uses, of the languages are open. In other words, editing the actual, core structure of the languages may be managed and standardized by official standards and specifications, but making use of the languages will be free for most projects.

History and Influences

Java was created by Sun Microsystems in 1991. Developers intended for Java to be used in interactive television, but this did not come to fruition. Instead, a public implementation of Java was released in 1995 for use in computers and web browsers. Eleven years later, in 2006, Sun became committed to a more open standard for Java, releasing parts of the language under an open-source GNU license.

Since the Oracle Corporation acquired Sun Microsystems in 2009, this standard has remained. However, Oracle has been more dogged in its efforts to chase after companies and developers who have failed to have their Java works approved. This was at the core of a heated 2012 court case, Oracle v. Google.

Meanwhile, JavaScript—originally known as Mocha—was developed by Netscape in 1995. Intended to be a user-friendly, lightweight companion to Java, JavaScript was first introduced to users through Netscape's web browser, Netscape Navigator. Following this, Microsoft developed a competing language, JScript, while JavaScript's developers sought support and standardization for their language. This was achieved in 1996 when the ECMA took control of JavaScript's development, which helped pave the way for international support and adoption in all web browsers. Technically, the language should be called ECMAScript, but most still know it by its original name of JavaScript.


Share this comparison:

If you read this far, you should follow us:

"Java vs JavaScript." Diffen LLC, n.d. Web. 25 Oct 2016. < >