Installing Tomcat on macOS 13.x Ventura Apache Tomcat 10.1.8 implements specifications that are part of the Jakarta EE 10 platform. Please note that applications that ran on Tomcat 9 and earlier will not run on Tomcat 10 without changes. Java EE based applications designed for Tomcat 9 and earlier may be placed in the $CATALINA_BASE/webapps-javaee […]
java
Installing Java on macOS 13 Ventura

For some time now, Java is not (pre-)installed anymore, let’s fix that. As I’m writing this, Java 19.0.1 is the latest version and Adoptium is one of the best places to find Prebuilt OpenJDK Binaries. Adoptium was known as AdoptOpenJDK, before the project was moved to the Eclipse Foundation. All available versions for supported platforms can be found here. […]
Installing Tomcat on macOS 12 Monterey

The Servlet 5.0 specification is out and Tomcat 10.0.x does support it. Time to dive into Tomcat 10. Prerequisite: Java Tomcat 10 requires Java version 8 or later and since OS X 10.7 Java is not (pre-)installed anymore. Let’s fix that by installing a Prebuilt OpenJDK Binary. Easy to follow details about how to install OpenJDK are […]
Installing Java on macOS 12 Monterey

For some time now, Java is not (pre-)installed anymore, let’s fix that. As I’m writing this, Java 17.0.3 is the latest LTS (Long Term Support) version and Adoptium is one of the best places to find Prebuilt OpenJDK Binaries. Adoptium was known as AdoptOpenJDK, before the project was moved to the Eclipse Foundation. All available versions for supported platforms […]
Installing Tomcat on macOS 11 Big Sur

The Servlet 4.0 specification is out and Tomcat 9.0.x does support it. Time to dive into Tomcat 9. Prerequisite: Java Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that by installing a Prebuilt OpenJDK Binary. Easy to follow details about how to install OpenJDK are available here. Anyway, after opening the Terminal app, java –version […]
Installing Java on macOS 11 Big Sur

Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that. As I’m writing this, Java 11.0.9 is the latest LTS (Long Term Support) version and AdoptOpenJDK is one of the best places to find Prebuilt OpenJDK Binaries. Easy to follow details about how to install OpenJDK are available here. However, the easiest way is to […]
Even or Odd – Lambda Edition

Very recently, I showed you one of the probably easiest ways, to host your very own Java-based web-service. Remember, we added providedCompile group: ‘javax.servlet’, name: ‘javax.servlet-api’, version: ‘4.0.1’ to the build.gradle file, implemented a WebServlet, and finally dropped a war file into Tomcat’s webapps directory. I know, you’ll have a hard time finding paying customers […]
Even or Odd

This is a quick demo, showing how to create a Java web-service in just a few minutes. I’m assuming you have Java and Tomcat already installed on you computer and use IntelliJ as your IDE, and gradle as your build-automation system. The simple task is to create a web-service that can answer if a provided […]
Installing Tomcat on macOS 10.15 Catalina

The Servlet 4.0 specification is out and Tomcat 9.0.x does support it. Time to dive into Tomcat 9. Prerequisite: Java Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that first. As I’m writing this, Java 11.0.1 is the latest version and AdoptOpenJDK is one of the best places to find Prebuilt OpenJDK Binaries. Easy to […]
From the Docks to the Gate

This is a story about a simple web-service that answers only one question: if a given number is prime. The core problem is first solved with a Java class, which is then wrapped into a WebServlet and tested within a web server environment. The web server, however, does not get directly installed, but a docker […]
Installing Java on macOS 10.15 Catalina

Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that. As I’m writing this, Java 11.0.4 is the latest version and AdoptOpenJDK is one of the best places to find Prebuilt OpenJDK Binaries. Easy to follow details about how to install OpenJDK are available here. However, the easiest way is to select OpenJDK 11 (LTS), […]
Configuring multiple SSL certificates for a single Tomcat connector

Sometimes you may want the same Tomcat instance to respond to requests for more than just one hostname. For HTTP this can easily be accomplished, by mapping those hostnames to the same IP address, using the tools provided by your registrar. Supporting HTTPS for multiple hosts is more involved since the SSL certificates need to […]
Installing an SSL Certificate on Tomcat

If you have Tomcat installed on your Mac or Linux computer, like I have shown here and here, you may sooner or later want to serve content not only through HTTP, but also securely through HTTPS. Instead of going the self-signed certificate route, where the certificate is signed with its own private key, I’m describing […]
Custom wakeup-words for an Android app

With most modern Android phones, just saying the phrase “OK Google” will launch the Google assistant app, which is capable of answering simple questions, or functioning as a app launcher. Following up with “open g mail” will launch the Gmail app on your phone, or saying “navigate home”, will open the Google Maps app, with […]
Serverless compute with Java, on AWS Lambda

Serverless computing is a cloud computing execution model, in which the cloud provider dynamically manages the allocation of machine resources. Serverless computing allows running applications and services, without thinking much about servers, runtime resources, or scaling issues. A very simple serverless computing application is intended to be used as a template project, a model, or starting […]
Debugging your Alexa Skill

Hosting a skill for the Amazon Alexa platform can be more or less involved, depending on the implementation language and hosting platform you pick. If you have some experience with the Java-Servlet life-cycle, then implementing a skill in Java, using Amazon’s Alexa-Skills-Kit library for Java, available in this Maven Repository and on Github, becomes an […]
Hosting an Alexa Skill yourself

If experimenting with the Amazon Echo / Alexa Skill Kit or running a so-called Skill in production, you generally have two choices: AWS Lambda functions on AWS Lambda (a service offering by Amazon Web Services) Hosting the Web service yourself. If you decide against AWS Lambda, you can build the Web service, using Java Node anything […]
Installing Java 8 and Tomcat 8 on Debian Jessie or Raspbian or RedHat

Apache Tomcat is a Servlet/JSP container and version 8.0 implements the Servlet 3.1 and JavaServer Pages 2.3 specifications. Please note that Apache Tomcat 8.0 requires a Java Standard Edition Runtime Environment (JRE) version 7 or later. So we start with installing a recent version of Oracle’s JRE. Install Oracle JRE 8 on Debian Linux (or Raspbian) […]
Java 8, Tomcat 8, and RESTEasy on Mac OS X

The main idea for this blog post was using the Mac, for quickly developing and deploying a Web app in Java. I’m using RestEasy on top of Tomcat as my server platform and Intellij IDEA as my preferred IDE. Once the webapp has been built and tested locally, IDEA is also used for archiving the […]
How private are private fields after all?

Last week, I sent the following brain teaser: public class Foo { private int secret = 47; public Foo() { new Hacker().hack(this); } public String tellSecret() { return String.valueOf(secret); } public static void main(String[] args) { System.out.println(”How secret are private members? ..”); System.out.println(”Psst: ” + new Foo().tellSecret(); } } Can you write a void hack(Object […]
Code Inspection

I recently got the chance to participate in another code inspection, in which among other things, the following line of code was heavily criticized for using String concatenation on constants and not using a StringBuffer object for the string operation in general. FindFile.FindFileInClasspath( kPropFilePrefix + “*”+ kPropFileSuffix + kKeyProperties, vPropFiles ); This is from a J2EE […]