java

recent posts related to java, jdbc, spring, etc.

Oracle doesn’t want Java EE any more alvin October 5, 2017 - 8:38am

In case you missed the news, after that drawn-out legal battle about Java and Android, Oracle doesn’t want Java EE any more, and it was adopted by the Eclipse Foundation.

Caliper, a tool for running benchmark tests in Java alvin September 5, 2017 - 10:24am

Caliper is a tool for running benchmarks (micro benchmark tests) in Java.

The Java 8 lambda Thread and Runnable syntax and examples alvin August 19, 2017 - 12:55pm

As a quick note, here are some examples of the Java 8 lambda Thread and Runnable syntax.

Java 8 Thread/Runnable lambda syntax

First, here’s the Java 8 lambda syntax for a Runnable, where I create a Runnable and pass it to a Thread:

A Mac/Java javapackager example (getting the application bundle root directory) alvin August 18, 2017 - 7:39pm

I wrote earlier about how to use the javapackager command to create a macOS application bundle from a Java application, so I won’t repeat all of that information here. Instead, in this article I just want to show how to display an image that’s stored in the Contents/Resources/Java directory of a Mac/Java application bundle.

Good javapackager video (macOS + Java) alvin August 16, 2017 - 9:47am

If you’re interested in packaging Java applications on macOS, this is a good `javapackager` video on YouTube.

Example: How to use javapackager to build a MacOS application bundle

Table of Contents1 - Building a MacOS application bundle with javapackager2 - The longer story3 - The Mac/Java class4 - The three scripts5 - javapackager notes

I recently learned how to use the Java javapackager command to build a macOS application bundle — i.e., a regular macOS application — from a Java application. In this tutorial I’ll show how to create a Mac application bundle from a simple Java class, in this case a Java Swing class.

The Mac/Java/Ant AppBundler error, java.nio.file.NoSuchFileException: Info.plist alvin August 15, 2017 - 5:30pm

As I learned recently, the Mac/Java AppBundler tool is a little out of date these days, but you can still use it with Java 8 and MacOS 10.12 to build Mac/Java applications. One problem you can run into is getting this ugly Info.plist error:

A ‘printf’ format reference page (cheat sheet)

Summary: This page is a printf formatting cheat sheet. I originally created this cheat sheet for my own purposes, and then thought I would share it here.

A cool thing about the printf formatting syntax is that the specifiers you can use are very similar, if not identical, between several different languages, including C, C++, Java, Perl, Ruby, and others, so your knowledge is reusable, which is a good thing.

How to build a macOS application from a Java Jar file

Table of Contents1 - Background2 - Requirements3 - Building your application4 - Note 1: Font smoothing5 - Note 2: Setting the “application category”6 - The Mac/Java AppBundler7 - More information8 - Summary

In this article I’ll show how to build a macOS application from a Java Jar file. I tested this with Java 1.8 on macOS 10.12.5 (Sierra) on June 29, 2017.

Three assumptions in this process are:

The rationale for Optional (in Java) alvin March 23, 2017 - 12:57pm

Wesley Reisz shared this nice image titled, “The Rationale for Optional” (in Java). Optional in Java is similar to Option in Scala.