Java: Introduction, How to Learn, and Resources
The most widely used programming language in the world today is Java (according to the PYPL measurement). With over 10 million active users and billions of devices, the Java language has shaped the modern world.
The power of the Java language has very little to do with the syntax or construction of the language itself, which is very similar to C and C++ in style. Instead, the power behind the Java exists in the Java Runtime Environment (JRE), which is a platform that can run on any type of computer, and a huge variety of devices.
This extreme level of portability is possible because the JRE runs on what is known as a Virtual Machine. A virtual machine that can be made to run on any device, which means that software written in the Java language can run on any device.
With this setup, Java is both compiled and interpreted. Java code is fed into a compiler that processes code into bytecode. This gets run by a bytecode class loader, then split into tasks for both an interpreter and a machine code generator. The Java Virtual Machine (JVM) platform does this all seamlessly for the developer, and can run on anything from a mainframe to to a Mars rover.
Java's relationship with the mobile market has been controversial with the legal battle between Oracle and Google, but no one can argue how valuable Java's cross platform capabilities have been in the mobile market. Java 2 Platform Micro Edition (J2ME) & third party Java tools, allow JRE implementation on all the major mobile operating systems, letting Java developers to code for any device they choose.
So Java is a popular language because the Java Platform is so easy to get setup and run on any device. The language itself has been refined and is perhaps the most well documented language of all. This combination of factors makes Java so popular, it's not just the language, it's the entire ecosystem.
Java's Origin Story
A project at Sun Microsystems in 1991 was spearheaded by James Gosling, the goal was to create interactive television. However, this proved to be too ahead of its time for cable providers, so the project pivoted to find a new primary use. The language was crafted using the familiar syntax of C++, under a project name called 'Oak.' The key concept that remained central to the project however, was the 'Write Once, Run Anywhere' (WORA) approach to using the language, portability was key. The goals of the project can be summarized succinctly as:
- It must be Simple, OOP, and Familiar to programmers
- It must be robust and secure.
- It needed to be architecture-neutral and totally portable across devices.
- Interpreted, Threaded, Dynamic - and thus easy to use, easy to scale.
- High Performance! Competition with C++ and other languages hinged on speed.
With all this packaged into one language and one platform, Java was released to the public in 1995. In the years to follow, browsers began to allow for Java applets to run on websites, and a strong evangelist team helped the Java enterprise take off. By 2006, Sun released Java as open source under the General Public License, since most of their revenue came from their enterprise platform. In 2009, Sun Microsystems was acquired by Oracle.
The first thing to do is try and understand the basics of the language. If you're new to programming, you will also want to become familiar with data types, object oriented concepts, and the basic control statements like loops. Here's some good resources for getting started with those basics:
- The Java Tutorials by Oracle
- Getting Started with Java - JavaCoffeeBreak.com
- Getting Started with Eclipse - this is a popular interactive development environment (IDE) for Java.
- Introduction to Java Programming - by IBM
Online Courses and Video Lectures
Enrolling for an online class, or just watching video lectures is a good way to make sure that you become familiar with all of the idea paradigms of the language. There are a lot of places to take classes online, either free, or for a small charge. Some might even provide certification.
- Introduction to Programming in Java by MIT Open Courseware
- Java Programming Courses on EdX
- Java Programming Courses on Coursera
- Java Tutorials on Lynda.com
- Java Programming Tutorials Youtube Playlist
- The Official Java Youtube Channel
Books & Resources
Books are great for people who want to have a comprehensive resource always readily at hand. Since Java is so big and well-used, there are a lot of free resources out there. Shop around and find a writing style you like, and be sure to watch out for the most recent editions.
- Java Programming on Wikibooks
- Amazon Best Sellers for Java Books
- Java Books from O'Reilly Publications
- Java on Bookboon.com
Forums & Communities
Forums and online communities are a great place as well. Through online conversation, IRC, and sharing of information, you can become much more embedded into the active community of users. This helps tremendously in learning quickly. Don't be afraid to ask questions on StackOverflow either.
Learning Java for Minecraft
One fun way to learn programming with Java is through the popular game Minecraft. While the game development community for Java is relatively small compared with C++ and C#, this title has a lot of users and utilizes Java for both game and server code. There are a lot of resources out there for this, because parents have figured out that this is a good way to get kids interested in coding at an early age! Modding Minecraft can be fun for adults too, and is a great way to learn Java.
- A Grownup's Guide to Minecraft and Writing Minecraft Mods - resources for adults
- Mod Design 1 - Learn to Code in Java with Minecraft - a class for kids
- Learn to Program with Minecraft Plugins - a book
- How to Make your own Minecraft Plugin & Learn Java - youtube guide
- The Young Person's Guide to Programming in Minecraft - Github page
- Java-Gaming.org - Not minecraft, but all gamedev on Java
Where to go from here?
Learning the basics of programming in general can easily be accomplished by knowing Java. It's a great first language, and learning new ones after Java is highly recommended. Also, since Java is used for a multitude of devices and applications.
As you may have noticed while looking through all the available books, there are a ton of different uses for Java, and each one can become an entire arena of expertise. As such an enormous platform, there will always be a need for Java developers. This could be about getting new devices Java capable, using Java to connect networks, or writing code to run web software. All of these niche uses of the language and the platform come loaded with a tremendous career opportunities, so get out there, learn, make and explore!