Archive for the 'Java' Category

Play 2 Framework not finding environment variables in IntelliJ IDEA on Mac

Recently I was experiencing an issue with the Play 2 Framework where it could not find environment variables on Mac OS when compiled within IntelliJ IDEA. The solution turned out to be simple, but could be inconvenient when an environment variable is used in many programs.

Read more »

Introducing CoffeeDOM, a JDOM fork for Java 5

When it comes time to work with XML in Java, the first thing I usually do is go to the JDOM website to check for a Java 5 update. Unfortunately, I am always disappointed. There has not been a major JDOM release in over 6 years and, if the JDOM mailing list is to be believed, no Java 5 version is planned. As a result, I have decided to take my own initiative and make CoffeeDOM, a JDOM fork with Java 5 support.

CoffeeDOM is intended as a natural evolution for JDOM developers. As such, there have been minimal changes to the API. CoffeeDOM adds support for Java 5 features like generics, enums, and covariant method return types, and reduces the amount of boilerplate required by making previously checked exceptions (like JDOMException) unchecked. In this article, I will briefly go over these changes.

(If you don’t want to bother with the article, you can skip right to the Google Code page or browse the Javadoc API documentation.)

Read more »

Things I miss from Java while programming in C#

One of the perks of being a freelance programmer is that I get to program in a lot of different languages, either because the client has dictated a certain language, has left the choice up to me, or limited me by what is supported by a host (Hi PHP!).

As fate would have it, I have had the good fortune to have extensive experience with both C# and Java. While many articles will list things a programmer misses from C# while coding in Java (properties, LINQ, reified generics, type inference, named and optional parameters, closures, continuations), this post intends to look at things a Java programmer might miss while coding in C#.

Read more »

Consuming a J2EE Web Service with PHP SOAP

I recently had to do some work for a company which involved using PHP to consume a J2EE-based WSDL web service. The project was fairly straightforward, involving only a one-way call to the web service, i.e. no result needed to be collected.

Read more »

Exploring Java and VB.Net Syntax, Part 1

The syntax of a programming language is a large part of how a programmer interacts with a language. Being somewhat of a programming language enthusiast, I’m always curious about how different programming languages stack up syntactically.

Today, I’m going to take a look at an variety of programming tasks and show how they are done in both Java and VB.NET (the .NET 1.1 version). Since both these languages have differing feature sets, I’ll try to only use features that both the languages have, in order to compare them fairly. I know this might misrepresent the complexity of the languages, and I’m cool with that. The purpose of this post is merely to explore and discuss the syntax of each language.

Read more »