Introduction to Java

Java is both the name of a computer platform installed in a personal computer or server and a cross-platform interpreted programming language

Java was originally released in 1995 by Sun Microsystems. In 2010, the company was acquired by the American company Oracle, so that as of 2023 is the owner of Java. The trademark Java belongs to Oracle, so it acquires a different name when is used by other organizations. For example, when Java EE was developed by Eclipse Foundation it had to change its name to Jakarta EE.

This post is an introduction to the Java platform and programming language. It may derived to other posts within this blog that extends info on the topic.

Java Programming Language

Java programming language is a high-level, class-based, object-oriented, cross-platform, interpreted programming language. It is one of the most popular, specially in cross-platform applications and business environments.

As an overview, Java source code needs to be compiled, generating what is known as Java bytecode. This bytecode can be run on any machine that has installed a virtual machine, that in the case of Java is called Java Virtual Machine (JVM).

Java source code is stored as Java files, with .java extension. Compiled Java bytecode is stored as Class files, with .class extension.

Just take note that Java bytecode could be run on virtual machines different to JVM. For example, latest Android devices run Java bytecode on Android Runtime (ART), optimised for Android portable devices, instead of JVM. ART run .dex files, that are .class files that has been recompiled in an extra step.

To know more details about the Java programming language and get tips, you can check this post.

Java Platforms and Components

To read an overview of Java platform and its components, please check this post.

This article is recommended to get a full understanding of Java Platforms and apprehend the (sometimes confusing) concepts of Java SE, JVM, JRE, JDK or OpenJDK that you will find throughout Java documentation and the current post.

Java Executable Files

In this section, we are reviewing two types of executable files:

  • Cross-platform Java executable files
  • Self-contained Java executable files

Summing up, there is a trade-off between cross-platform and self-contained executable files. Each type of executable files offers one of these characteristics while sacrificing the other.

Cross-platform Java Executable Files

Compiled Java programs have the form of Class files (.class extension). This is the most basic way to deploy a Java program.

When there are many files involved in development (various Java source code files, images, sounds, folders, etc.) it gets burdensome to deploy all of them to the users. Because of this, developers may look to generate a single executable file.

A JAR (Java ARchive) file is an executable file with the .jar extension that assemble all program resources within a single file. This eases the program distribution while keeping cross-platform capabilities. JAR files can be generated during program compilation.

To create a JAR file, you can follow the instructions of this post.

I remind that Class files and JAR files contain Java bytecode that cannot be directly executed by the OS, and a JVM installed in the computer is required to run this code. Because of this, Java programs have the disadvantage of requiring a pre-installed JDK/JRE software on each computer.

On the other hand, Java programs can be run on any device that has a JVM.

Self-contained Java Executable Files

Self-contained Java executable files get rid of the JVM software dependency of Java programs, while sacrificing the cross-platform aspect of Java programs.

One option to create a self-contained Java executable file is JPackage utility, that is available from OpenJDK 16 and versions above. It allows to create a self-contained native executable file for a specific OS.

To know more about how to create a self-contained Java executable file, please check this post.

Creating your first Java program

If you want to create your first simple Java program, you can follow the instructions on this post.

Java Training

There are official free Java training courses available for Java 8. You can find Java program examples on this external link. Some examples available as .jnlp files, based on Java Web Start (JWS), so you may need to install IcedTea or OpenWebStart in order to be able to run them.

Note: If you want to read more about JWS compatibility, you can read the JWS section of this post.

There are also courses from Oracle University. The starter level is for free, but you need to pay for advance levels. You can find them on this external link.

Java Certifications for Professionals

Oracle offers different Java certifications for professionals. They are available on this external list.

Java IDEs

There are plenty of Integrated Development Environment (IDEs) that are compatible with Java.

Java IDEs featured on this post:

  • Apache NetBeans
  • IntelliJ IDEA
  • Eclipse

Apache NetBeans

To read about Apache NetBeans, please check this post.

Java Tools

java

java command-line tool executes Java applications.

javac

javac is a Java compiler. You need to introduce source code files as input and it gives .class files as output.

javadoc

javadoc is a tools that generates Java documentation, based on the source code and comments added to it.

javap

javap is a command-line tool that can be used to find the version on which a Class file has been compiled.

You can find more information about javap tool on this external link.

Java Libraries

You can read this post about Java libraries.

Java Build Automation Tools

Popular Java build automation tools are:

  • Maven
  • Ant
  • Gradle

To read more about build automation tools, please check this post.

Java Communities

Communities are helpful in case you need help or share opinion with other users and developers.

Forums

Java Forums:

  • Reddit r/Java
  • Reddit r/JavaHelp
  • Stackoverflow.com
  • Java Programming Forums
  • JavaHispano

Reddit r/Java

Reddit has one channel to discuss about Java, called r/Java.

This channel is to discuss features, news, etc., not to get help. If you need help, go for r/JavaHelp.

Official web

Reddit r/JavaHelp

Reddit channel to get help about Java.

Official web

Stackoverflow.com

You can leave a message at Stackoverflow and tag it as “java”.

Official web

Java Programming Forums

Java Programming Forums is one of the biggest forum about the topic, before the arrival of general platforms like Reddit or Stackoverflow.

Official web

javaHispano

javaHispano is probably the biggest Spanish-speaking Java community.

Official web

Oracle Developers Community

There is a Java section within the Oracle Developer Community.

Official web

You might also be interested in…

6 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *