Category Archives: Java

Java 9 jshell OSX bug workaround

Java 9 jshell You’ve downloaded the current build of Java 9, and perhaps Kulla. You try to run jshell and blammo. Stack dump. Introduction The Workaround Summary Resources Introduction Table of Contents So, you’ve installed Java 9 on your Mac. Maybe one of the Early Access builds. I’m playing around with modules, so I’m using […]

Posted in Java | Tagged , | 5 Responses

Multiple Java VMs on OSX

Multiple Java VM on OSX Introduction Eclipse Globally Summary Resources Introduction Table of Contents Let’s start by reviewing the baroque installation of Java on OSX. Try these (highlighted) commands in a terminal.

So, when you install Java, /usr/bin/java is the vm command. It’s a symbolic link to the “current version”. In my case Current […]

Posted in Java | Leave a comment

JDK 8, OSX, and Netbeans

Have you installed an Early Access Release of JDK 8? You may want to still use JDK 7 for some projects. I have a JavaFX 2 project that needs JDK 7 since there will be API changes in JDK8. I’ve previously covered using non Apple JDKs on Mountain Lion. Unfortunately, that doesn’t affect NetBeans default […]

Also posted in NetBeans | Tagged , , | 1 Response

JDK 7 on OSX

You can download a dmg from Oracle’s download page. You might expect that you’d run the installer and you’d be ready to go. Not me. I had previous versions of Java installed. In my startup file (.bash_profile) I had set this:

With this set, java -version still reported 1.6. I set it to this […]

Posted in Java | Tagged , | 1 Response

JDK 7 for OSX

In the past, developers obtained the JDK from Apple. Apple has announced that they will no longer provide a JDK. They will support the Open JDK project instead. Here are he details of the Mac OS X Port Project within OpenJDK. You can check status of the port on the project’s Wiki There is also […]

Posted in Java | Tagged , | Leave a comment

Plain Old Java Object – POJO

You have probably read someplace that Plain Old Java Object AKA Pojo was the invention of a committee. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000 This reminds me of Woody Allen’s short story in Getting Even on the “invention” of the Earl of Sandwich. 1745: After four […]

Posted in Java | Tagged , | Leave a comment

The Big O

You may have seen someone write this:

Why didn’t they just write

Well, remember that List is the interface and ArrayList and LinkedList are implementations. That means it is OK to point at the implementations through the interface type – which is where we started this discussion. But if the variable is the […]

Posted in Java | Tagged , , | Leave a comment

ANT and XDoclet

I just upgraded to Ant 1.5.1 and XDoclet 1.2b2. I was getting this message: “[ejbdoclet] Make sure the jar file containing the ejbdoclet class is on the classpath specified in the that defined {2}. These classes are needed in order to generate correct output.” Real good. The {2} tells me that they missed a message […]

Posted in Java | Tagged , | Leave a comment

I was up this morning at 4:30 AM. My 18 lb. Maine Coon cat Giacomo wasn’t taking no for an answer. He likes to get on my chest and chew on my chin until I pay attention to him. So, while I was up I went to the server. I remembered that Phillies tickets were […]

Posted in Java | Tagged , | Leave a comment

Turkeys and Gizzards : Java Inner Classes

Let’s look at a Turkey class.

And here is a main that will run it

Nothing remarkable right? It’s a start at implementing some behavior. This execution simply tells the bird to do what its interface says it can do. It doesn’t know much about how the Turkey does what it does; just […]

Posted in Java | Tagged , , | Leave a comment