What is Java Used For?

Java is a computer programming language used to create software for servers, computers, tablets, phones, and all kinds of devices. Java creates programs found on web sites, in credit cards, in Blu-ray players, ATMs, HVACs, Minecraft and other games, robots, cars and programs found just about anywhere computers exist. Java applications run in small embedded microchips, normal computers, and massive multi-tier enterprise web-based applications.

Java is one of the most popular programming languages on the planet. Billions of devices run Java. Any sort of software can be written using Java.

Java programming is taught by most universities and colleges. This ensures a large base of developers for employers to choose from. Java is a mature language, developed in the 1990’s. Java software is in NASA’s Mars Rovers, so Java is an interplanetary language, too.

This is part of the Java Tutorial series I’m writing for my son.

Do not confuse Java with JavaScript. JavaScript is another programming language that for historical marketing purposes shares a similar name. They are different languages, however. Adding to the confusion, Google created a compiler that compiles Java down to a highly optimized version of JavaScript for use on web sites, computers, and smart phones. JavaScript, though, is not the same as Java. However, applications originally written in Java often run as JavaScript.

Java is secure. Like any software, Java should be updated regularly. Java usually notifies users when there are security updates, just like Windows or OS X does. Currently, most web browsers do not support Java run as Applets. This is due to security concerns over the old Java web browser plugin. The crackdown on the Java plugin by web browsers has made security issues with Java in the web browser a moot point. Most Java applets on the web no longer work with modern web browsers, so the question of whether non-working Applets are secure doesn’t matter.

Most programs written in Java compile down to Java bytecode. Java bytecode runs on the Java Virtual Machine, also known as the JVM. Many people refer to Java and the JVM both as Java. Technically, Java is the language, and the JVM is the interpreter than runs Java applications. The distinction never used to matter when Java was first created. These days, many languages compile down to Java bytecode and run on the JVM.

JVM languages include C, Perl, Lisp, Clojure, Python, Ruby and Tcl. Even JavaScript can compile down to Java bytecode and run on a JVM. Of course this adds to the confusion between Java and JavaScript.

Java and the JVM work well with other languages. Java can interact directly with memory address on it’s host machine, though New I/O (NIO) libraries. Java can also interface with existing native libraries through Java Native Interfaces (JNI), or other modern libraries. Also, languages that compile down to Java bytecode usually can communicate with Java libraries running on the JVM.

As mentioned above, Google created GWT and a compiler that creates HTML 5 JSON applications from Java source code. As stated on their web site, “GWT is a development toolkit for building and optimizing complex browser-based applications.” Many of Google’s applications use GWT.

When writing GWT applications, all the client-side Java source code is compiled down to highly optimized JavaScript. The client-side Java can handle form validation, manipulation of canvas objects, and communication with server-side logic and databases. Google’s tools and compilers allow for the creation of complex applications and even 3D games for web browsers.

Java started life in the 1990’s as an alternative to C++. It arrived on the scene just as the Internet took off. Java was originally conceived as a language for embedded programming of microchips. However, it found its first big acceptance as a highly secure and powerful server-side programming language. Java was a perfect replacement for the C and Perl programs running servers on the early Internet.

For a time, Java based Applets gave interactive applications life in web browsers. The old Java plugins that Applets used eventually lost favor, partially due to security concerns. Most of the Applets from this era of the Internet no longer run on modern web browsers.

As Java matured, general desktop applications and embedded applications came to profit from the convenience and power of Java. These days, Java has found a place in nearly every type of application that gets written.