As Java developers our job is not only to write working code but also to document it properly. Since its beginnings Java provided us with the javadoc tool which generates this documentation from the specially formatted documentation comments we wrote in the source code. In these documentation comments we use various tags to document parameters, return values, exceptions thrown etc. It is often the case that we must include a code snippet to show intended usage of our code. Until Java 18 we relied on the @code tag, perhaps in combination with <pre>…</pre> if we needed multi-line snippets. But now we have a better way and that is by using new @snippet tag. Let’s see its basic usage in action!

As Java developers we often must work with multiple projects at the same time. Even if all projects you develop as a part of your job use the same JDK version, you might still have private projects with a different one, or you simply want to experiment with the new JDK as it’s released. In those cases, using jEnv to assign an appropriate JDK to every project is a life saver. Best of all, it’s very easy to use and it doesn’t require wrangling with the JAVA_HOME environment variable. Let’s quickly see it in action!

Java 18 is currently the latest version of Java. Even though it isn’t a LTS release, it’s worth installing it so we can test new features. In this article I will show you how to install JDK 18 on MacOS and to setup IntelliJ IDEA so you can write Java applications against it.