Isn’t the Industry Reluctant to Use Anything Other Than an LTS Version?
Initially, yes, but only because of misunderstandings and simply wrong statements from people like myself. Just as you used to update your Java 8 when you heard that there was an update, you will update to the next version. The difference is that there is now a regular predictable schedule. This aligns with modern application development practices and other platforms that expect more frequent but manageable updates rather than tectonic shifts every 3-4 years. This will help Java as it continues to be the number one development platform for the cloud.
I Write Web Code Against an Application Server, Don’t They All Need Java 8?
Currently, the latest versions of IBM’s Open Liberty and RedHat’s Wildfly run on Java 12, as do others. My informal tests running servlet and JSF applications compiled with Java 12, but with the Maven settings for the compiler source and target to 1.8, it showed no problems even when the server, Payara, was running on the Java 8 JVM.
What About All Those Other Distributions of Java?
Amazon, SAP, Azul, RedHat, Bellsoft, and AdoptOpenJDK, just to name a few, are making distributions of Java available now. The only significant difference between them and what is available from https://jdk.java.net is that these come with installers while https://jdk.java.net only supplies zip/gz files. They are built almost completely from the same source code. Java does not need to be installed on any platform. Just unzip the distribution and configure your application, IDE, or OS to know where it is. All an installer does is unzip and write the optional system configuration to the OS for you. These companies simply provide an alternative to Oracle for paid support or provide a JDK for platforms other than Intel/AMD such as for ARM. There have been alternative distributions of Java for some years now, for example, with Red Hat providing an OpenJDK release since 2008 on Java 6.
Conclusion
If you are just starting to code in Java, then use the most recent version. If you are using Java, then update to the most recent version. If you are worried about possibly running afoul of Oracle licensing or prefer to favour open source then download Java from https://jdk.java.net otherwise download from the OTN.
Written with the assistance of Donald Smith
java,free,openjdk,version,opinion,lts,JDK,release cycle
Published at DZone with permission of Ken Fogel, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
This document instructs you on how to set up a Java programming environment for your Mac OS X computer. It also provides a step-by-step guide for creatingand compiling a Java program in IntelliJ and executing itfrom the command line.
You will need a Mac runningMac OS X 10.13 (High Sierra) to Mac OS X 10.15 (Catalina).
0. Install the Java Programming Environment |
The installer installs and configures a Java programming environment, includingOpenJDK 11 andIntelliJ IDEA, Community Edition 2020.1.
- Log in to the user account in which you will be programming.Your account must have Administrator privileges.
- Download the Mac OS X installerlift-java.pkg.
- Double-click lift-java.pkg to install the software.Enter your Mac OS X password when prompted and use all of the default options.
Warning
If you have previously used IntelliJ,run this installer only if you want a clean re-install.The installer overwrites IntelliJ IDEA CE.app andany previous IntelliJ 2020.1 settings.
- Delete lift-java.pkg (if it is not automatically deleted).
1. Open a Project in IntelliJ |
You will develop your Java programs in an application called IntelliJ IDEA, Community Edition.
IntelliJ organizes Java programs into projects.In our context, each project corresponds to one programming assignment.A typical project contains Java programs, associated data files, andcourse-specific settings (such as compiler options, style rules, and textbook libraries).
- Download the project for your programming assignment to a convenient location(such as the Desktop).
[ sample project for COS 126 (Princeton) ]
[ sample project for COS 226 (Princeton) ]
[ sample project for Computer Science: Programming with a Purpose (Coursera) ]
[ sample project for Algorithms, Part I (Coursera) ]
Double click the zip file to unzip.This creates a project folder with thename of the corresponding programming assignment (such as hello
or percolation
).Delete the zip file.
Warning
The project folders contain course-specific information. Be sure to downloadthe one corresponding to your institution and course.
- Launch IntelliJ via Finder → Applications → IntelliJ IDEA CE.app.
- When you launch IntelliJ for the first time,
- IntelliJ may displaytheJetBrains privacy policy.Scroll down and Accept.
- IntelliJ may ask if you want to send anonymous usage statistics to JetBrains. Choose your preferred option.
- To open a project from the Welcome screen,click Open and select the project folder.You should see an assignment logo (in the main editor window) and a list of project files (in the Project View sidebar at left).
When you launch IntelliJ for the first time,it may take a minute or two to index your files;some features (such as auto importing) will be unavailable until this process completes.
Warning
Do not select
Create New Project;this option is intended for advanced programmers.Also, always use
Open with a project folder, not an individual file.
- When you are finished working, select the menu optionIntelliJ IDEA → Quit IntelliJ IDEA (⌘Q) to exit IntelliJ.The next time you launch IntelliJ, your recent projectswill appear in the Welcome screen for easy access.
2. Create a Program in IntelliJ |
Now you are ready to write your first Java program.IntelliJ features many specialized programming toolsincluding line numbering, syntax highlighting, bracket matching, auto indenting,auto formatting, auto importing, variable renaming, and continuous code inspection.
- To create a new Java program:
- Re-open IntelliJ and the project (if you closed it in the previous step).
- Click the project name in the Project View sidebar (at left), so that itbecomes highlighted.
- Select the menu option LIFT → New Java Class.When prompted, type HelloWorld for the Name and click OK.
- In the main editor window, complete the Java program
HelloWorld.java
exactly as it appears below.(IntelliJ generates the gray boilerplate code automatically,along with the course header block comment.)If you omit even a semicolon, the program won’t work. - As you type, IntelliJ highlights different syntactic elementsin different colors.When you type a left bracket, IntelliJ adds the matching right bracket.When you begin a new line, IntelliJ indents it.
- To save the file, select the menu option File → Save All (⌘S).When you save the file, IntelliJ re-formats it (if necessary).
3. Compile and Execute the Program (from IntelliJ) |
Now, it is time to execute (or run) your program.This is the exciting part, where your computer follows the instructionsspecified by your program.Before doing so, you must compile your program intoa form more amenable for execution on a computer.
- Select the program that you wish to compile and execute in the the Project View sidebar. The program should now appear in the main editor window.
- To compile your program,select the menu optionLIFT → Recompile 'HelloWorld.java' (⌘B).If the compilation succeeds, you will receive confirmationin the status bar (at bottom).
If the compilation fails, a Recompile panel will open up (at bottom),highlighting the compile-time errors or warnings.Check your program carefully for typos, using the error messages as a guide.
- To execute your program,select the menu option LIFT → Run 'HelloWorld' with Arguments (⌘E).Since this program takes no command-line arguments, click OK.
You should see the output of the program (in white), along with a messagethat the program finished normally (with exit code 0).
Tip
Use the LIFT menu to compile and execute your program from IntelliJ.The Build and Run menus support additional options for advanced programmers.
Also be sure that the main editor window is active before using the LIFTmenu (e.g., by clicking the code you want to compile or execute).
Java 8 For Mac
4. Compile and Execute the Program (from the command line) |
Is Java For Mac Free Trial
The command line is a simple and powerful mechanism forcontrolling your programs (e.g., command-line arguments,file redirection, and piping).IntelliJ supplies an embedded terminalfor easy access to the command line.
5. Textbook Libraries (from the command line) |
To make our textbook libraries accessible to Java from the command line,you will use our wrapper scripts.
Java For Mac Free Download