Scripting in Java

Did you know that you can compile and run scripting languages like JavaScript, Python, Ruby and many others directly from your Java code? API responsible for it has been created as a result of Java Specification Request 223 and sits in the javax.script package.
Let’s see on a minimalist example how to use the Java Scripting [...]

Simple guide to Java Message Service (JMS) using ActiveMQ

JMS let’s you send messages containing for example a String, array of bytes or a serializable Java object, from one program to another. It doesn’t however use a direct connection from program A to program B, instead the message is sent to a JMS provider and put there in a Queue where it waits until [...]

A guide to Java SimpleDateFormat in examples

Today I want to show you some examples of how you can use SimpleDateFormat class in your code. I hope some of them will be new and surprising!
The basic example
First the most basic usage of the class. Lets use it to format Date object into a simple string showing day, month and a year:

SimpleDateFormat simpleDateFormat [...]