Java

Top Red Hat Developer News of 2013

Red Hat brought a LOT of new and excellent application development products and capabilities during 2013, so I thought I would assemble this list for you here in case you missed any.  Note that this is not a complete list (and comment if I missed something that you feel should be mentioned), and by the way, it is listed in random order.

Red Hat Software Collections general availability.  Yes, I will list this first as it’s my personal favorite as I started working on this two years prior as part of a project initially called Robbin, a moniker cleverly coined by Brian Gollaher, our RHEL developer tools product manager.  (We learned that people would be distracted if we gave it a name too soon in the planning phase – so they needed to agree on the definition first.  Then we could name it.  Our temporary offices were on Robbins Road then.)  At the time, we all understood the gap that we were trying to address, but it took some time to define it for enterprise use cases and then get some engineering resources (thank you, Denise Dumas).  So now here we are and we’re getting great feedback.  I can’t wait to share news on the next release!  😉

Continue reading “Top Red Hat Developer News of 2013”

Share

OpenJDK, AArch64, and Fedora

For the really impatient reader: OpenJDK for AArch64 on Fedora is now available. Skip to the end of this blog for information about how you can get it.

For everyone else:
This is the first of my AArch64 OpenJDK blogs. I’m the project lead of the AArch64 OpenJDK port, and I’ll be blogging here from time to time. There may not be many people reading this blog who don’t know what AArch64 is, but it’s the new 64-bit version of the wildly popular ARM processor. General availability of real AArch64 hardware isn’t going to be for a while yet, but we really want OpenJDK to be ready as soon as it is.

Oh, and OpenDK is the reference implementation – the gold standard – of the Java system and programming language.

We’ve been porting the OpenJDK implementation of Java to the new AArch64 processor architecture for a while now, and it’s starting to come together.

Continue reading “OpenJDK, AArch64, and Fedora”

Share

Changing objects in flight, without a Debugger

How to change data in-flight, without a Debugger

Do you ever wish you could change the behavior of some object in the middle of a bunch of method calls?  I sometimes do.

Maybe you want to set some properties on an object to replicate a fault.  Maybe you’d like to force a specific return value from a method for some reason.  These are both very possible, without altering the source code for your application.

I like to do this through Byteman.  Byteman is a JBoss project that deals with bytecode injection.  This means that you can inject code you want to run, specifying where you want to run it.  It’s sort of like AOP, except I think it allows more freedom for the user.  It’s also pretty easy to use.

Here’s how:

1)  Make a helper class to do the work you want done
2)  Put the helper class in a .jar
3)  Write the Byteman rule that tells the helper class to do it’s thing

That’s it!  So here’s the example.

Part 1, the helper class
**********************************

public void addMarker(Message msg){
System.out.println(“Changing Message contents.”);
Body msgBody = msg.getBody();
msgBody.add(“Hey, I’ve got changed content”);
System.out.println(“Done changing Message contents”);
}
***********************************

Continue reading “Changing objects in flight, without a Debugger”

Share

From upstream OpenJDK to RPMs on your machine

Over the past few years, I have been asked on and off as to what the process is for the RPMs that get into Red Hat Enterprise Linux and Fedora repositories. Over those years, the answer has evolved as we attempt to better the process. As it stands right now, there is a difference between how OpenJDK6, OpenJDK7 and OpenJDK8 (preview in Fedora 19) end up into RPMs. This post will shed some light into what those processes are.

OpenJDK6
This was the first (well, technically second, if you count the brief period when IcedTea7 was in Fedora before OpenJDK6) OpenJDK based JDK that was introduced in Fedora and RHEL.

OpenJDK6 has been EOLd by Oracle as of February 2013, and Red Hat has taken over maintainer-ship since. Since the goal of Fedora is to have the latest and greatest, we allowed OpenJDK6 in Fedora to EOL after Fedora 16 in favour of OpenJDK7. Enterprises however have much longer cycles and we continue to ship and support OpenJDK6 in RHEL-5 and RHEL-6 today.

OpenJDK6 in Fedora and RHEL has always been provided via a project named IcedTea. IcedTea was started by Red Hat to address build and binary plug issues that were in the initial version of OpenJDK. The purpose of IcedTea was to provide build scaffolding that made it easy to build OpenJDK, to provide open-source replacements for binary plugs, and to provide fixes that couldn’t otherwise make it into upstream OpenJDK.

The process for shipping new OpenJDK6 releases in Fedora and RHEL hasn’t really changed over the years and it is as follows:

Continue reading “From upstream OpenJDK to RPMs on your machine”

Share

How Long Does It Take to …

One common idiom in performance monitoring is how long did it take for a program to do something. For example you may want to know the time taken for database queries in PostgreSQL or just-in-time translations in a Java Virtual Machine. SystemTap and user-space markers in Linux packages make it much easier to determine the duration of those operations.

The user-space markers compiled into Linux packages mark key points in the code where particular actions occur. The user-space markers also provide arguments that provide additional information about the action. For example, the markers and the available arguments in PostgreSQL can be listed using using the SystemTap command:

$ stap -L 'process("postgres").mark("*")'

The two user-space markers related to the start and completion of a query are:

Continue reading “How Long Does It Take to …”

Share