Skip to main content
View Archives: Homepage | Spotlights | Articles | Weblogs

java.net Spotlight

It’s time for another ControlsFX release, this time taking the version number to 8.0.5. As always, ignore the minor version increment – this is a massive release. This release has new controls and a number of bug fixes, so it is recommended that everyone upgrade as soon as possible. As per usual, the latest version is always available in maven central and you can download the release directly from the ControlsFX website...

[03/04/2014]

Show the world your embedded Java + Internet of Things (IoT) application for a chance to win a trip to JavaOne 2014! 12 winners will receive a trip to JavaOne 2014, the #1 place to meet world-renowned Java experts. In addition, six students will receive laptops and certification vouchers. Team up and submit the video and code of your project by May 30, 2014. Don't know how to start? We are providing eight free online training sessions in March and April...

[03/03/2014]

Memory mapped files are a good and often overlooked tool. I won’t go into the details here on how they work, but I will quickly summarize their advantages: lazy loading and write caching provided by the OS (you don’t have to write your own and it’s a safe bet that the OS’s one is well performing); easy reading for complicated binary data (for example one which has all kind of relative offsets encoded in it); can be used as a very high performance IPC mechanism...

[03/02/2014]

Early Access builds of JDK 7u60 have been updated with Build b07. This build updates HotSpot in JDK 7u60 to HotSpot 24.60 build 09, updates time zone support data to tzdata2013i, and fixes various issues, one of which was reported by Groovy developers - thanks! If you find issues during your own testing of this build, please report a bug...

[02/28/2014]

The results of our recent Java EE 8 Community Survey are in! As we promised earlier, the final phase of this outreach is an opportunity for you to let us know your priorities among the most frequently requested of the features from the surveys... So today, we are launching the final survey (intelligently named 'Part 3'). The idea is very simple, we are granting you a budget of 100 points to tell us which proposed improvement(s) you think is (are) important...

[02/26/2014]

If the following method thread-safe? How to make it thread-safe?... ... This post explains a general interview question that has been asked by Google and a lot of companies. It’s low-level and not about how to design concurrent program. First of all, the answer is NO. The method is not thread-safe, because the counter++ operation is not atomic, which means...

[02/25/2014]

One of the common questions asked during my #JavaEE7 presentations around the world is how do WebSockets compare with REST ? First of all, REST is a style of architecture so what really people mean is RESTful HTTP. As an architecture cannot be compared with a technology. But the term is so loosely used that they are used in place of each other commonly. Lets start with a one line definition for WebSocket …

[02/24/2014]

During this blog post I will reveal the two most important reasons why I write automated tests... Automated tests prove that my code works in the future as well. Manual testing only proves that my code worked when I tested it. Automated tests document the expected behavior of my code. This is extremely valuable information for the developer who has to maintain the application...

[02/23/2014]

The JavaScript folks often abuse anonymous functions to create local scope. Like any other language feature, this can be abused, but in some contexts, local scoping is really awesome. Java also allows for local scoping, although until Java 8, this has been equally cumbersome...

[02/21/2014]

Jersey is the excellent Java JAX-RS specification reference implementation from Oracle. Last year, when we were starting to build RESTful backend web services for a high-volume website, we chose to use the JAX-RS API as our REST framework and Spring framework for dependency injection. Jersey was our JAX-RS implementation of choice...

[02/19/2014]

Ready to dive into the Internet of Things? Take the new, free, online course "Develop Java Embedded Applications Using a Raspberry Pi." The Oracle Learning Library has created this course which provides code, examples, and experts to teach you and answer your questions. Java experts Stephen Chin, Jim Weaver, Simon Ritter, Angela Caicedo, and Tom McGinn will lead you through basic exercises...

[02/18/2014]

The difference between Stress and Load Testing is already clearly defined by wikipedia. Stress testing (sometimes called torture testing) is a form of deliberately intense or thorough testing used to determine the stability of a given system or entity. It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results...

[02/17/2014]

Today we’re announcing new update releases: Oracle Java ME Embedded 8 Early Access #2 and Oracle Java ME SDK 8 Early Access #2. These releases are designed to continue to drive Java ME 8 momentum in the industry by giving the community access to the latest Java ME 8 functionality and to demonstrate Oracle’s commitment to delivering Java ME 8 as a modern and purpose-built embedded software platform that addresses...

[02/16/2014]

Querydsl is a framework that allows us to create elegant, type-safe queries for a variety of different data-sources like Java Persistence API (JPA) entities, Java Data Objects (JDO), mongoDB with Morphia, SQL, Hibernate Search up to Lucene. In the following tutorial we’re implementing example queries for different environments...

[02/13/2014]

Why do we need a new date and time library? A long-standing bugbear of Java developers has been the inadequate support for the date and time use cases of ordinary developers. For example, the existing classes (such as java.util.Date and SimpleDateFormatter) aren’t thread-safe, leading to potential concurrency issues for users...

[02/12/2014]

So, in JRockit there was this neat little dynamic MBean from which you could access all the JVM performance counters as attributes. Tonight I ended up in an e-mail thread leading me to think about how to retrieve the HotSpot ones. This is of course all very unsupported, and counter names/content and even the very API is subject to change at any given release. I will now go ahead and show how something similar to the PerformanceCounters MBean available in JRockit can be built....

[02/11/2014]

JDK 8 includes JSR-310, a new date and time library. But what about functionality that didn't make it into the JDK?The main ThreeTen project is now essentially complete. The project was developed and delivered via JSR-310 into OpenJDK and JDK 8. However, as part of that process, certain pieces of functionality were rejected and/or excluded from the JDK... The TheeTen-Extra project provides a home for that functionality...

[02/10/2014]

There are three ways to create new objects in Java programming language: * The telescoping constructor (anti)pattern; * The Javabeans pattern; * The builder pattern. I prefer the builder pattern over the other two methods. Why? Joshua Bloch described the builder pattern and the benefits of using it in Effective Java. He did an excellent job and I will not repeat these benefits in this blog post. Instead, I will describe three other reasons why I prefer the builder pattern over the telescoping constructor pattern and the Javabeans pattern. 1. It Helps You to Enforce Better Design...

[02/09/2014]

If you’re used to writing Groovy, this may appear “so 2003″ to you. We know. Groovy has known a very useful way to write string-based SQL since its early days. Here’s an example written in Groovy... Note also Groovy’s built-in String interpolation, where you can put expressions into strings. But we’re in Java land, and with Java 8, things get better in the Java / SQL integration as well, if we’re using third-party libraries, instead of JDBC directly...

[02/07/2014]

With Java 8 only round the corner (available in March), we wanted to give you a session on Java 8 and what is new that you can play with. Simon Ritter, the head Java Evangelist at Oracle, presents to us what has changed since Java 7, including lambdas, default methods, Streams and much much more. Descriptions and discussions are followed up with code samples and examples of how the new functionality can be used...

[02/05/2014]

When I talk about jOOQ at conferences, I always show this slide containing a bunch of very common JDBC mistakes that people often commit... Can you find the bugs? Some of them are obvious... But then, there’s another very subtle bug that most people are unaware of because the fix was only possible since the upgrade in Java 6 / JDBC 4.0. See the solution, below...

[02/04/2014]

The week of January 20, the International Oracle User Group Community (IOUC) met at the Oracle Redwood Shores campus for their annual leadership summit. The IOUC is a community of leaders representing Oracle users groups worldwide. Members include leaders from over 900 user groups representing individual countries in Europe, Middle East, Africa, Latin America, Asia Pacific, and North America...

[02/03/2014]

Hardware Transaction Memory has the potential to allow multiple threads to speculatively access the same data structure at the same time and let the cache coherence protocol determine if a conflict occurred. HTM aims to give you the scalability of fine grain locking, the simplicity of course grain locking, and performance close to no locking at all...

[02/02/2014]

We all know that writing code is the easiest part of application development. Tracking down problems, and especially those related to performance and concurrency, is what’s tricky. While I was always aware that the Java Virtual Machine provided great forensics tools, it was only when I worked with Python and C++ for three years that I was confronted with the sad reality outside of Java land. That reality is best summarized as: “You’re on your own dude, good luck!” Since there’s really not much to compare the Java profiling tools to...

[01/31/2014]

At the gamification session of the International Oracle User Group Community (IOUC), leaders discussed how to drive membership. Typically, they give away licenses, books and goodies to encourage attendance at monthly meetings. Others have used gamification to get their communities to brainstorm on mascot names, or post pictures and comments on social media... “Turn life into a game, drive engagement of audiences, make the experience more enjoyable and get users to come back ” are the key advantages of gamification according to user group leader Jim Bettencourt...

[01/29/2014]

The previous Java.next installment compared and contrasted functional coding styles in Scala, Groovy, and Clojure. This article delves more deeply into the filter, map, and reduce functions in the Java.next languages. A series of short coding examples help you to sort out the somewhat confusing differences in how the three languages name these key functional constructs...

[01/28/2014]

There is a lot of interest in the IoT trend, so it wasn't surprising that the "Internet of Things" session was full that at the Oracle International User Group Leader Summit. (The IOUC was held last week at Oracle's Headquarters in Redwood Shores, CA, and included over 20 Java User Group leaders.) Sharat Chander, Principal Product Director at Oracle, assembled a panel of experts to discuss IoT...

[01/27/2014]

Simply put, big data is a big deal. As the volume, velocity, and variety of big data continue to increase, so do the opportunities for creating new applications for big data. The new issue of Java Magazine is all about big data. The good news is that Java developers are well positioned to take advantage of this opportunity because so many of the tools for big data are built on the Java Virtual Machine (JVM)...

[01/26/2014]

In the air traffic management (ATM) domain, System Wide Information Management (SWIM) is a new open standard-based information infrastructure which will connect all ATM stakeholders, aircraft as well as all ground facilities. In the recently held annual SWIM innovation contest, where innovations in software related to this domain are highlighted, Barco Orthogon won the top prize, in one of the two categories, namely "applications", with a NetBeans Platform solution....

[01/25/2014]

Congratulations to the newest Star Spec Lead, Brian Goetz. Brian is the Spec Lead for JSR 335, Lambda Expressions for the Java Programming Language, and won the 2013 Outstanding Spec Lead Award as part of the 11th Annual JCP Program Awards during JavaOne 2013. JSR 335 is part of upcoming release of Java SE 8, the next version of the Java Platform, Standard Edition, and...

[01/22/2014]