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 […]

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 […]

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) […]

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 […]