Dzone Researchguide Java2019 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38



   
         

                          

                                  
DZONE.COM/GUIDES

Dear Reader, Table of Contents


Despite reoccurring debate, Java is most certainly not dead. The JDK’s newest
release cycle and continued widespread use has proved that Java is still the 3 Executive Summary
BY KARA PHELPS
number one choice for our main applications. And yet, the ecosystem is in the
middle of major changes. 4 Key Research Findings
BY JORDAN BAKER
Last July, Oracle announced a new subscription-based pricing model that
would require Java SE commercial users to acquire a special license in order to 7 Diving Deeper Into Java
continue to receive support and updates. Oracle customers and personal users
would continue to have access to the OpenJDK, and other JDKs based on it, 8 Java Garbage Collection
but companies could no longer access open-source versions for business use. BY ERIC GOEBELBECKER

Along with changes in pricing, the adjusted release cycle offers a new version 11 How to Use Recent MicroProfile and JDK Features to
of the JDK every six months. And, JDK 11, released in October 2018, is the most Scale Your Apps in the Cloud
BY BRIAN BENZ
recent long-term support version, and best option for developers who want to
upgrade from Java 8. 16 MicroProfile: What You Need to Know
BY REZA RAHMAN
But, according to the 2018 JVM Ecosystem Survey, more than 88 percent of
developers continue to use Java 8, despite newer versions. Many developers 20 Beyond Java 8
are hesitant about switching to Java 9 or higher due to fear of breaking existing BY TRISHA GEE

applications. Additionally, developers are unable to find support in Java 9 or


23 Executive Insights on the Current State of the Java _
up for some of their tools and IDEs.
Ecosystem
BY TOM SMITH
So, what does this mean for the future of the JDK?

25 Java Solutions Directory


Well, it means a lot of things. But most importantly, it means that Java will
continue to exist across a wide variety of platforms and applications.

The existence of multiple Java versions and open-source movements have DZone is...
paved the way for new languages, tools, and platforms to emerge. Kotlin and BUSINESS & PRODUCT MARKETING EDITORIAL
Matt Tormollen Susan Wall Matt Werner
Clojure, for example, are the second most popular JVM languages, after Java, CEO CMO Publications Coordinator
and are being successfully implemented across a wide range of applications. Matt Schmidt Aaron Tull Sarah Davis
President Dir. of Demand Gen. Publications Associate
Terry Waters Waynette Tubbs Mike Gates
Based on the report, “Exactly 9 in 10 JVM users are using Java for their main Interim General Manager Dir. of Marketing Comm. Content Team Lead
applications. While many projects today are defined as multi-language or Jesse Davis Ashley Slate Kara Phelps
EVP, Technology Sr. Design Specialist Content & Comm. Manager
polyglot, the part on the JVM primarily runs Java.”
Colin Bish Tom Smith
Kellet Atkinson Member Marketing Spec. Research Analyst
Media Product Manager
In this guide, we focus on the latest tools and features in the JVM and how to Suha Shim Jordan Baker
Acquisition Marketing Mgr. Content Coordinator
best implement them in your existing Java projects. Open-source Java tools SALES
Kendra Williams Cathy Traugot
Andre Lee-Moye
such as MicroProfile, which provides various microservices features to Java EE, Sr. Director of Media Sales Content Marketing Mgr.
Content Coordinator
and scaling apps in the cloud are some of the more exciting, and challenging, Chris Brumfield Lauren Ferrell
Sales Manager Content Coordinator
new ways to build upon your existing Java code. Jim Dyer Lindsay Smith
Sr. Account Executive Content Coordinator
Java is still free and continues to be the trusted language by developers all over Tevano Green
Sarah Sinning
Sr. Account Executive
PRODUCTION Staff Writer
the world — Java is not going anywhere. The release cycle will simply provide Chris Smith
Brett Sayre
developers with faster updates and new features on a regular basis. And while Account Executive Director of Production

Alex Crafts Billy Davis


change can be hard, it’s an exciting time as we welcome the new era of Java. Key Account Manager Production Coordinator

Eniko Skintej Naomi Kromer


Thanks for reading and we hope you enjoy! Key Account Manager Sr. Campaign Specialist

Craig London Jason Budday


Key Account Manager Campaign Specialist
WRITTEN BY LINDSAY SMITH Jordan Scales Michaela Licari
CONTENT COORDINATOR, DEVADA Sales Development Rep. Campaign Specialist

THE DZONE GUIDE TO JAVA PAGE 2 OF 38


DZONE.COM/GUIDES

Executive
said they had no opinion. This year, 32 percent of respondents replied
“yes” to that question — decreasing from 44 percent who answered
“yes” last year.

Summary IMPLICATIONS
Interest in “new style” Java 10 features appears to be waning among
survey respondents. Of course, a year has now passed since the release
of Java 10, and we are now on to Java 12 (editor's note: Java 12 had
not been released at the time the survey was taken), but 58 percent of
BY KARA PHELPS CONTENT & COMMUNITY MANAGER, DEVADA
survey respondents reported that they are not currently writing code
in Java 10 or above. Improvements may get pushed out to developers
Despite the rise of languages like Kotlin and Clojure in recent years,
more quickly with the new six-month release cadence, but we may be
Java is still a powerhouse. It’s one of the most popular programming
seeing the beginning of “release fatigue.”
languages in the world, with more than 9 million developers over the
two decades and counting that it’s been publicly implemented. This
RECOMMENDATIONS
year, we asked 492 Java developers for their thoughts on the latest Old habits die hard (especially in the enterprise). It makes sense to
versions of the language, changing paradigms, the use of Java in their continue using the Java features that keep your legacy applications
organizations, and much more. running. 33 percent of survey respondents said they never mix “old
style” and “new style” Java. However, it may be worth checking out
JAVA 8 IS STILL THE FAVORITE newer features to solve stubborn issues. When asked where they mix
DATA “old” and “new,” 33 percent of respondents said they do so with APIs
While developers may use several versions of Java depending on their for creating unmodifiable collections. 32 percent said they did so using
organization or use case, 86 percent of survey respondents reported that the optional.orElseThrow() method, 30 percent said they remove
they use Java 8 to build new applications. 24 percent use Java 11, 10 deprecated methods, and 27 percent said they use the local variable
percent use Java 10, 9 percent use Java 9, 15 percent use Java 7, and 6 type inference.
percent use Java 6 or below. Similarly, 83 percent of respondents said
they use Java 8 in existing applications. Just 11 percent use Java 11, 5
REACTING TO ORACLE’S JDK CHANGES
percent use Java 10, and 7 percent use Java 9. 42 percent said they still
DATA
use Java 7 in existing applications, and 25 percent said they use Java 6 33 percent of survey respondents using Java 8 said they use Oracle’s
or below. JDK and have no plans to switch due to the change in long-term
support. Another 33 percent of Java 8 users said they are planning
IMPLICATIONS
to move to a different distribution of the JDK, and 21 percent said
Java 8 has now been out for five years, which has given enterprises
they are using a different distribution already. Among Java 11 users,
some time to adopt it. Java 8 also included updates to improve
4 percent said they use Oracle’s JDK and don’t plan to switch. 10
application performance, as well as to make functional programming
percent of these users plan to move to a different distribution, and 11
easier. Oracle released one last update to Java 8 in January 2019 and
percent are already using one. (Java 12 had not been released at the
will support the release through December 2020. Despite these end-of-
time of the survey.)
life preparations, though, developers still use Java 8 the most.

IMPLICATIONS
RECOMMENDATIONS Starting with the April 2019 update, Oracle JDK 8 will be restricted for
The wide use of Java 8 means that it’s probably a good time to learn
commercial use, but there are plenty of alternative options. Many other
how to take advantage of the functional programming options that
providers are offering free OpenJDK builds, and starting with Java 9,
Java 8 provides, if you aren’t already. 44 percent of survey respondents
Oracle has provided OpenJDK builds that are free for commercial use
said they and their teams are “comfortable” mixing object-oriented and
(although they’re only updated for six months). A higher percentage of
functional paradigms. 34 percent of respondents said they were
Java 8 users seem to know how they’ll be managing the transition.
“somewhat” to “very” uncomfortable, however.

RECOMMENDATIONS
OLD SCHOOL VS. NEW SCHOOL “Java is still free,” according to a prominently shared Google doc by
DATA the Java Champions describing Oracle’s changes in long-term support
61 percent of survey respondents said they have no opinion as for its JDK. They’re right — the open-source options for Java 8 and
to whether the “new style” Java 10 features make it more fun to 11 have full capabilities for commercial use, and personal use will
program in Java. That’s an increase from last year, when 49 percent continue to be free as well.

THE DZONE GUIDE TO JAVA PAGE 3 OF 38


DZONE.COM/GUIDES

• Three main roles were reported:

Key Research
–– 42% work as developers/engineers
–– 24% work as developer team leads
–– 19% work as architects

Findings • Respondents reported working on four main types of


software projects:
–– 83% develop web applications
–– 49% work on enterprise business apps
BY JORDAN BAKER –– 24% develop native mobile applications
CONTENT COORDINATOR, DEVADA
–– 15% work on high-risk software

Java 8 Still the Favorite


Despite the fact that it’s eight years old, Java 8 remains the
Demographics most used and preferred version of the Java language. When
For this year’s DZone Guide to Java survey, we received 804 we asked respondents what versions of Java are being used by
total responses, with 492 complete responses. Below is the basic their organization to work on existing applications, 83% reported
demographic breakdown of the respondents. using Java 8, while Java 7 came in a distant second with a 42%
adoption rate. When we compare these statistics to our data
• Respondents have an average of 16 years of experience in IT. on the two types of software most respondents develop (web
• Respondents live in four main geographical areas: applications and enterprise business applications) as delineated in
–– 36% in Europe the Demographics section, we find that Java 8, though dominant
–– 18% in South Central Asia among both groups, proves slightly more popular among
–– 15% in the USA developers/organizations working on enterprise business apps.
–– 12% in South America Among respondents who reported developing web apps, 82% said
they use Java 8 on existing applications, while 87% of those who
• Survey-takers reported working in three main industry verticals:
reported developing enterprise business apps told us they use Java
–– 22% work for software vendors
8 for existing applications.
–– 15% work in finance/banking
–– 12% work in consulting
Given Java 8’s age, its dominant position in existing applications
• A majority of respondents work for enterprise-level is less surprising than its widespread use in building new
organizations. applications. 86% of survey-takers reported using Java 8 to create
–– 27% for organizations sized 100-999 new applications, while only 24% said they use Java 11, 10% use
–– 21% for organizations sized 10,000+ Java 10, and a mere 9% use Java 9. If we compare our data on
–– 20% for organizations sized 1,000-9,999 Java 8 usage rates against our data on respondents developing

SURVEY RESPONSES
What versions of Java are being used at your organization when What versions of Java are being used in existing apps at your
building new apps? organization?

 

 

 

 

 

 

           

THE DZONE GUIDE TO JAVA PAGE 4 OF 38


DZONE.COM/GUIDES

web and enterprise business applications, we see a similar trend appears that respondents’ comfort level in mixing object-oriented
to that reported above. Among respondents working to develop and functional programming varied by the types of applications
web applications, 87% use Java 8 to create their new apps, with they develop. Among those respondents working on web
24% use Java 11, 10% use Java 10, and 10% use Java 9. For those applications, 45% reported feeling comfortable mixing the object-
respondents working to develop enterprise business apps, we oriented and functional paradigms, while 9% said they were very
found that 90% use Java 8 in the building of new applications, while, comfortable. Additionally, 21% of respondents working as web
again, 24% use Java 11, 10% use Java 10, and only 7% use Java 9. app developers told us there were “somewhat uncomfortable”
mixing these two paradigms, while 4% reported being “very
Even with the extreme popularity of Java 8, one would expect the
uncomfortable.” But among those respondents developing
newer versions of the language (i.e. Java 10 and 11 as well as the
enterprise business applications, 35% reported feeling comfortable
soon-to-be-released Java 12) to garner some excitement from a
mixing object-oriented and functional coding paradigms, while 5%
developer community that’s so interested in Java. Yet, a majority
reported feeling very comfortable. On the other side of the coin,
of respondents seemed to be lukewarm in their opinions of the
28% of these respondents said they feel somewhat uncomfortable
newer versions of Java and the features these versions brought with
in this practice, while 10% feel very uncomfortable. One reason for
them. When we asked respondents what they thought constituted
enterprise business app devs’ reluctance to mix coding paradigms
the most important new feature introduced in Java 10, well over half
could come from the fact they work with massive code bases filled
(70%) reported that they had no opinion on the matter. We also asked
with legacy code that takes advantage of older coding paradigms.
survey-takers which features of Java 11 they were using, and five Thus, introducing object-oriented or functional paradigms (or a mix
features of Java 11 (Epislon, ZGC, Flight Recorder, readString() and of the two) could result in a need for large refactoring projects.
writeString(), and the new HTTP client) all had non-adoption rates
(i.e. are not being used) of 80% or higher. And finally, when asked When it comes to development practices specific to the Java
about the new features in Java 12 for which they were excited, 53% of language, however, a greater level of parity appears among the
respondents reported “none of the above.” responses. When asked how they mix “old” and “new” style Java
code, 33% reported using APIs for creating unmodifiable collections,
Despite this general lack of enthusiasm around the newer versions
another 33% said they never mix “old” and “new” Java, and 32%
of Java, over 60% of survey-takers seem excited for the future of the
said they continue to use the optional.orElseThrow() method in
language. 43% told us they feel fairly optimistic about Java’s future,
their code. Additionally, 30% of respondents told us they mix “old”
and another 29% feel very optimistic.
and “new” style Java while working on the removal of deprecated
methods. This widespread mixing of “old” Java standards makes
Development Practices and Coding Paradigms sense given the continued dominance of Java 8.
Object-oriented and functional programming represent two of the
more popular coding paradigms in use today. This is reflected in The JDK, no matter the provider, has become an integral part to
that fact that 44% of respondents reported feeling “comfortable” any Java developer's work. It’s interesting to see that the JDK
using and mixing these two paradigms and another 8% asserted developers use seems to be dependent on the version of Java
feeling “very comfortable” with this practice. Interestingly, it they’re currently working with. We asked respondents if they were

SURVEY RESPONSES
How comfortable are you and your team at mixing object- Which of the following platforms/runtimes/operating systems do
oriented and functional paradigms? you primarily develop on?


  

 

  
    
   
 
 


  

  
  

        

THE DZONE GUIDE TO JAVA PAGE 5 OF 38


planning to stop using Oracle’s JDK due to the change in Oracle’s applications, 82% target Linux and 49% target Win32/64.
JDK long-term support and saw an interesting variance in answers.
Not all technologies in the survey witnessed such variance,
Among users of Java 10 and 11, the most popular response was, “I
however. Indeed, when we asked which API quality attributes
am using a different distribution of the JDK.” Among respondents
are most important, we saw almost mirrored results across
using all other versions of Java (i.e. Java 6-9), the most popular
three respondent groups. Among the general survey population,
responses were, “I am planning to move to a different distribution
74% told us they care about simplicity, 60% said consistency,
of the JDK” and “I use Oracle’s JDK and have no plans to switch.”
60% reported performance/robustness, 58% feel productivity
Thus, while users of every iteration of Java have some interest in
is important, and 54% care about learnability. When we again
exploring non-Oracle SDKs, it seems that those developers using
pare the data down to reflect those respondents working on
the newer versions of the language have already jumped the
web applications and enterprise business applications, we see
preverbal Oracle SDK ship.
almost the exact same results. Among web developers, the
most important API quality attributes were simplicity (74%),
Java Adjacent
consistency (64%), performance/robustness (62%), productivity
Despite all the features we’ve discussed so far, Java and the
(59%), and learnability (54%). Among enterprise business
applications built upon it cannot operate in a vacuum. Thus, in this
developers, the most important API qualities reported were
section, we’ll focus on how developers use Java alongside other
simplicity (75%), performance/robustness (66%), productivity
important technologies. To start off, we found that respondents
(61%), consistency (59%), and learnability (53%). The only notable
had two main platforms/runtimes/operating systems on which
variance among all these factors is how performance/robustness
they primarily develop. 69% of respondents told us they typically
appears more important for respondents working on enterprise-
develop on Linux-based operating systems, while 56% reported
level applications.
using Win32/64. When we compare this data to our data on web
application and enterprise business app developers, we find that
To round out this report, let’s examine the use of microservices
these two systems remained, far and away, the most popular
among Java developers. Of those surveyed, 58% reported using
platforms/runtimes/operating systems to develop on. 72% of web
microservices in some capacity during development, while
application developers reported using Linux and 54% use Win32/64,
another 18% said they do not, but are planning on adopting
while 69% of enterprise business app developers develop on Linux
microservices. Of note, microservices proved more popular
and 63% use Win32/64. Interestingly, when we asked respondents
among those respondents working on web applications than
which of these platforms/runtimes/operating systems they target,
those working on enterprise business apps. Of those respondents
we saw a bigger discrepancy between the answers of web app and
currently developing web apps, 63% told us they are currently
enterprise business app developers. Among the general survey
using microservices in some manner, while 18% said they are
population, 84% of respondents target Linux and 42% target
not using microservices but are planning to in the future. Among
Win32/64. When we narrow this down to respondents working on
respondents currently working on enterprise business applications,
web applications, we find that 86% target Linux and 38% target
we found that 54% use microservices in their development efforts,
Win32/64; and among respondents working on enterprise business
and 22% are planning on adopting microservices.

SURVEY RESPONSES
Are you planning to stop using Oracle's JDK due to the change in Which of the following API quality attributes are most important
Oracle's JDK long-term support? for you (for any API, not just web APIs)?



  

   

 
  
    

  
    
 


  
        

THE DZONE GUIDE TO JAVA PAGE 6 OF 38


Zones
Java dzone.com/java
The largest, most active Java developer community on the web. The Java

Diving
Zone provides news and tutorials on Java tools, performance tricks, and
new standards and strategies that keep your skills razor-sharp.

Microservices dzone.com/microservices

Deeper
The Microservices Zone will take you through breaking down the
monolith step-by-step and designing microservices architecture
from scratch. It covers everything from scalability to patterns and
anti-patterns. It digs deeper than just containers to give you practical

Into Java
applications and business use cases.

Web Dev dzone.com/webdev


The Web Dev Zone is devoted to all things web development—and
that includes everything from front-end user experience to back-end
optimization, JavaScript frameworks, and web design. Popular web
technology news and releases will be covered alongside mainstay web
languages.

Twitter Refcardz
Java Application Vulnerabilities
@trisha_gee @rafabene Java applications, like any other, are susceptible to gaps in security.
This Refcard focuses on the top vulnerabilities that can affect Java
applications and how to combat them.
@brunoborges @dianecraigdavis

Java Containerization
@jessitron @sugrue This Refcard focuses on the design, deployment, service discovery, and
management of Java applications on the open-source project called
Docker so that you can get your Java application up and running inside
@danielbryantuk @mon_beck a Docker-deployed Linux container.

Java API Best Practices


@lunivore @s1m0nw1
In this Refcard, you'll learn how to make well-documented,
consistent, evolvable APIs to help your users make the most of your
Java applications.

Books Podcasts
Effective Java Java Pub House
Learn about the latest language and library features that Java has to offer, Learn about real issues that developers face when programming
get insight into Java subtleties, and see how modern Java supports multiple Java, like O/R setups, threading, troubleshooting, and more.
paradigms.
The Changelog
Java Concurrency in Practice Through conversations with hackers, leaders, and innovators, learn
Dive into basic concepts of concurrency and thread safety, techniques for about OSS code, service meshes, cloud-enabled apps, and more.
building and composing thread-safe classes, using concurrency building
Software Defined Talk
blocks, and more.
Dive into various topics of interest to Java developers, like Kubernetes,
serverless, cloud, DevOps, and coding.
Modern Java in Action
Explore the new features of Java 9 like support for reactive programming and
learn how to build on your existing Java skills with the newest techniques.

THE DZONE GUIDE TO JAVA PAGE 7 OF 38


DZONE.COM/GUIDES

QUICK VIEW

01. Java 11 and 12 added new garbage

Java Garbage
collectors that can help you test and run
your code

02. The Epsilon GC lets you find out


what happens if you run your Java code

Collection
with no garbage collector.

03. Shenandoah and ZGC are two new


garbage collectors for Java apps that
need lots of memory.

BY ERIC GOEBELBECKER
SERVER-SIDE SOFTWARE ENGINEER

Java manages heap memory for you. You run your application inside HOW TO USE EPSILON
a virtual machine (JVM). The JVM does the work of allocating space COMMAND LINE OPTIONS NOTES
when necessary and freeing it when it is no longer needed. The garbage Unlock Java experimental
-XX:+UnlockExperimentalVMOptions
collector (GC) is what does this work for you. options.

-XX:+UseEpsilonGC Use Epsilon GC.


Recycling memory involves garbage collection "cycles" that have an
impact on performance. How much impact depends on the nature Set heap size. JVM will exit
of your application and the GC you choose. The good news is that -XmxXg with an OutOfMemoryError
if this amount is exceeded.
there's more than one garbage collector, and each recent release of
Java has offered more choices. You can pick the GC that best suits your Generate a heap dump if JVM
application's needs. -XX:HeapDumpOnOutOfMemoryError runs out of memory.

New Garbage Collectors Run specified command


-XX:OnOutOfMemoryError= when an out-of-memory error
The last two releases of Java introduced three new GCs. We'll take a
occurs.
look at each of them and what they add to the ecosystem.

Java 11 introduced Epsilon and the Z garbage collector (ZGC). Epsilon WH Y USE A NO - OP GC ?
is the "no-op" garbage collector. It allocates new memory but never A no-op garbage collector is useful for measuring and managing
recycles it. ZGC promises to manage vast amounts of memory with high application performance. Active garbage collectors are complex
throughput and short pause times. programs that run inside the JVM alongside your application. They incur
overhead that can cause latency and reduce throughput.
Java 12 adds the Shenandoah Garbage Collector. Like ZGC, it manages
large heaps with short pause times but uses a very different approach. Epsilon removes the impact GC has on performance. There are no GC
cycles or read or write barriers. When using the Epsilon GC, your code

Epsilon Garbage Collector runs in isolation. You can use it to see how garbage collection affects
WH AT IS EPSILON? your app's performance and what your memory threshold is since it'll
Epsilon is a passive or "no-op" GC. It handles memory allocation but tell you when it runs out. If you think you only need four gigabytes of
doesn't recycle it when objects are no longer used. When your application memory, run it with -Xmx4g and see if you're right. If you're wrong,
exhausts the Java heap, the JVM shuts down. In other words, Epsilon will rerun it with XX:HeapDumpOnOutOfMemoryError enabled and take a
allow your application to run out of memory and crash. look at the heap dump to see where you're wrong.

THE DZONE GUIDE TO JAVA PAGE 8 OF 38


DZONE.COM/GUIDES

If you need to squeeze every bit of performance out of your application, very important. The heap must be large enough to accommodate your
Epsilon might be your best option for a GC. But you need to have a application but also needs extra headroom so Z can meet new requests
complete understanding of how your code uses memory. If it creates while relocating active objects. The amount of headroom you need
almost no garbage or you know exactly how much memory it uses for depends on how quickly your application requests new memory.
the period it runs in, Epsilon is a viable option.
ZGC will try to set the number of threads itself, and it's usually right. But
The Z Garbage Collector if ZGC has too many threads, it will starve your application. If it doesn't
WH AT IS THE Z G ARB AGE COLLEC TOR? have enough, you'll create garbage faster than the GC can collect it.
ZGC is a low-latency GC designed to work well with huge amounts of
memory. The Oracle documentation refers to multi-terabyte heaps in WH Y USE ZGC ?
its description of Z. Oracle introduced ZGC in Java 11. In Java 12, Oracle ZGC's design works well with applications large heap sizes. It manages
added performance fixes and class unloading even though Z is still in these heaps with pause times under 10ms and little impact on
experimental status. It's only available on 64-bit Linux. throughput. These times are better than G1's.

ZGC does its marking in three phases. The first is a short stop-the-world
HOW DOES ZGC WORK?
phase. It examines the GC roots, local variables that point to the rest
ZGC works concurrently with your application, performing all its work
of the heap. The total number of these roots is usually minimal and
in its threads. It uses load barriers for heap references. Load barriers
doesn't scale with the size of the load, so ZGC's pauses are very short
cause fewer delays than those imposed by the G1 collector's pre- and
post-write barriers. and don't increase as your heap grows.

Once the initial phase completes, ZGC continues with a concurrent


ZGC takes advantage of 64-bit pointers with a technique called pointer
phase. It walks the object graph and examines the colored pointers,
coloring. Colored pointers store extra information about objects on the
marking accessible objects. The load barrier prevents contention
heap. (This is one of the reasons it's limited to the 64-bit JVM.) By limiting
between the GC phase and any application's activity.
the GC to 4TB heaps, the developers have 22 extra bits in each pointer to
encode additional information. Z uses four extra bits at the moment. Each After ZGC has completed marking, it moves live objects to free up large
pointer has a bit for finalizable, remapped, mark0, or mark1. sections of the heap to make allocations faster. When the relocation
phase begins, ZGC divides the heap into pages and works on one page
The Z garbage collector remaps objects when memory becomes
at a time. Once ZGC finishes moving any roots, the rest of the relocation
fragmented. The mapping avoids the performance hit incurred when
happens in a concurrent phase.
the GC needs to find space for a new allocation. Pointer coloring helps
with remapping since a remapped reference discovers the new location ZGC's phases illustrate how it manages large heaps without impacting
at the next access. performance as application memory grows.

When your application loads a reference from the heap, ZGC checks
the extra bits. If it needs to do any extra work (e.g. getting a remapped Shenandoah
WH AT IS SHEN ANDOAH?
instance), it handles it in the load barrier. It only has to do this once,
Shenandoah is another garbage collector with low pause times. These
when it loads the reference. This sets it apart from the write barriers
times are short and predictable, regardless of the size of the heap.
used by mainline garbage collectors like G1.
Shenandoah was developed at Red Hat and has been around for several
The Z garbage collector performs its cycles in its threads. It pauses years. It's now part of the Java 12 release.
the application for an average of 1 ms. The G1 and Parallel collectors
Like ZGC, Shenandoah does most of its work in parallel with the
average roughly 200 ms.
running application. But its approach to garbage collection is

HOW TO USE ZGC different. Shenandoah uses memory regions to manage which objects

COMMAND LINE OPTIONS NOTES are no longer in use and which are live and ready for compression.
Shenandoah also adds a forwarding pointer to every heap object and
-XX:+UnlockExperimen-
Unlock Java experimental options. uses it to control access to the object.
talVMOptions

-XX:+UseZGC Use ZGC. HOW DOES SHEN ANDOAH WORK?


Shenandoah's design trades concurrent CPU cycles and space for
-XmxXg Set heap size.
pause time improvements. The forwarding pointer makes it easy to

-XX:ConcGCThreads=X Set number of GC threads. move objects, but the aggressive moves mean Shenandoah uses more
memory and requires more parallel work than other GCs. But it does the
ZGC is a concurrent garbage collector, so setting the right heap size is extra work with very brief stop-the-world pauses.

THE DZONE GUIDE TO JAVA PAGE 9 OF 38


DZONE.COM/GUIDES

SHEN ANDOAH PH A SES of heap allocated since the last cycle. This heuristic incurs
Shenandoah processes the heap in many small phases, most of which throughput overhead but provides the best space reclamation.
are concurrent with the application. This design makes it possible for
the GC to manage a large heap efficiently. FAILURE MODES
Shenandoah needs to collect heap faster than the application it's
The first phase contains the first stop-the-world pause in the cycle. It serving allocates it. If the allocation pressure is too high and there's not
prepares the heap for concurrent marking and scans the root set. Like enough space for new allocations, there will be a failure. Shenandoah
ZGC, the length of this pause corresponds to the size of the root set,
has configurable mechanisms for this situation.
not the heap. Next, a concurrent phase walks the heap and identifies
reachable and unreachable objects. • Pacing: If Shenandoah starts to fall behind the rate of
allocation, it will stall allocation threads to catch up. The stalls
The third finishes the process of marking by draining pending heap
are usually enough for mild allocation spikes. Shenandoah
updates and re-scanning the root set. This phase triggers the second
stop-the-world pause in the cycle. The number of pending updates and introduces delays of 10ms or less. If pacing fails, Shenandoah

size of the root set determine how long the pause is. will move to the next step: degenerated GC.

• Degenerated GC: If an allocation failure occurs, Shenandoah


Then, another concurrent phase copies the objects out of the regions
starts a stop-the-world phase. It uses the phase to complete
identified in the final mark phase. This process sets Shenandoah apart
the current GC cycle. Since a stop-the-world doesn't contend
from other GCs since it aggressively compacts the heap in parallel with
with the application for resources, the cycle should finish
application threads.
quickly and clear the allocation shortfall. Often, a degenerated
The next phase triggers the third (and shortest) pause in the cycle. It cycle happens after most of the cycle's work is already
ensures that all GC threads have finished evacuation. When it finishes, completed, so the stop-the-world is brief. The GC log will
a concurrent phase walks the heap and updates references to objects report it as a full pause, though.
moved earlier in the cycle.
• Full GC: If both pacing and a degenerated GC fail, Shenandoah
The last stop-the-world pause in the cycle finishes updating the falls back to a full GC cycle. This final GC guarantees the
references by updating the root set. At the same time, it recycles the application won't fail with an out-of-memory error unless
evacuated regions. Finally, the last phase reclaims the evacuated there's no heap left.
regions, which now have no references in them.
WH Y USE SHEN ANDOAH?
HOW TO USE SHEN ANDOAH Shenandoah offers the same advantages as ZGC with large heaps but
COMMAND LINE OPTIONS NOTES more tuning options. Depending on the nature of your application, the

-XX:+UnlockExperimen- Unlock Java experimental different heuristics may be a good fit. Its pause times might not be as
talVMOptions options. brief as ZGC's, but they're more predictable.

-XX:+UseShenanodoahC Use Shenandoah GC. While Shenandoah was not made available as part of Java until version
12, it's been around longer than ZGC. It's seen more testing and is even
-XmxXg Set heap size.
available as a backport for both Java 8 and 10.

-XX:ShenandoahGCHeuristics= Select heuristics.


Conclusion
Java GCs have come a long way in a few short years. The default G1
SHEN ANDOAH HEURISTIC S collector has made significant improvements since Java 7, and three
You can configure Shenandoah with one of three heuristics. They govern new ones have been added to the platform.
when the GC starts its cycles and how it selects regions for evacuation.
Depending on your needs, one of these new GCs may be what you need
to take your Java application performance to the next level.
1. Adaptive: Observes GC cycles and starts the next cycle so
it completes before the application exhausts the heap. This
heuristic is the default mode. ERIC GOEBELBECKER is an experienced software engineer
with more than 25 years of experience working with
2. Static: Starts a GC cycle based on heap occupancy and market data, financial transactions, and news. Outside of
allocation pressure. work, he enjoys training dogs and practicing martial arts. He enjoys
writing for technical blogs as an author for Hit Subscribe, an online
3. Compact: Runs GC cycles continuously. Shenandoah starts a new content agency. LinkedIn Twitter
cycle as soon as the previous finishes or based on the amount

THE DZONE GUIDE TO JAVA PAGE 10 OF 38


DZONE.COM/GUIDES

How to Use Recent QUICK VIEW

01. Learn how to launch single-file


source code programs and a standard

MicroProfile and JDK HTTP to client help you build Java into
your cloud applications.

Features to Scale Your


02. See how to work around the
removal of XML APIs when working with
MicroProfile and Spring apps.

Apps in the Cloud


03. Learn about building fault
tolerance and health checks into your
microservices without code.

BY BRIAN BENZ
SENIOR CLOUD DEVELOPER ADVOCATE AT MICROSOFT

Managing a potentially unlimited number of autonomous, loose- with microservices, and makes things simple and easy to follow.
ly coupled, and frequently updated microservices on top of a
The ability to launch single-file programs enables quick, local
flexible cloud infrastructure creates new challenges for develop-
testing of a developer's code and can also greatly simplify the
ers. This article outlines features of recent JDK and MicroProfile
instructions needed to run the code in a container-based environ-
updates for reliably deploying and scaling cloud applications
ment. Note this sentence in the motivation section of JEP 330:
while continuously integrating network and service updates.
We'll also cover tips for enabling documentation, authentication, "Single-file programs — where the whole program fits in a single
and managing decoupled application dependencies, resources, source file — are common in the early stages of learning Java and
and configuration. when writing small utility programs."

Adding Notable JDK Updates to Your Of course, microservices could be described as small utility
Microservices programs. And you can create a container to load a JDK image
The latest JDK release has an interesting collection of new features in this context. Then, you just add a COPY to load the file into the
that can help with building microservice-based applications. container and a CMD to get it started in your Dockerfile:
JDK 11 has been generally available since September 2018 and
FROM adoptopenjdk/openjdk11:latest
is the first long-term support version after Java 8.  As always,
COPY mymicroservice.java / mymicroservice.java
features and scheduled releases of the latest JDKs are managed
CMD ["java", "mymicroservice.java"]
via the JDK Enhancement Proposal (JEP) Process. I've included
the JEP release numbers and links as a handy reference to the full Now, imagine how this simplifies testing. Instead of building/
details of each new feature. compiling and running your code in a container, you can run it in
different JVM and OS versions by simply changing the `FROM`
Launching Single-File Source Code Programs and line in your Dockerfile!
a Standard HTTP Client
The ability to launch single-file source code programs (JEP 330), Next up in your single-file microservice, you'll likely need to speak
and the new standard HTTP Client (JEP 321), goes hand-in-hand to other microservices, with at least a call and response, probably

THE DZONE GUIDE TO JAVA PAGE 11 OF 38


DZONE.COM/GUIDES

using HTTP. To accomplish this in a very simple and readable way, Flight Recorder (JEP 328) takes the analysis one step further and
implement the new standard HTTP Client (JEP 321) as part of your dials into the JVM to track performance bottlenecks and errors in
microservice. An HttpClient object sends requests via asynchro- the running code. 
nous requests, HTTP/2, and web sockets. An HttpRequest object
From the JEP 328 document:
contains a request method and headers, and an HttpResponse
object returns information from the target. Here's a great exam- "Flight Recorder records events originating from applications, the
ple of a simple HTTP client implementation from Anthony Bruno JVM, and the OS. Events are stored in a single file that can be attached
with a comparison of the URLConection object it replaces. to bug reports and examined by support engineers, allowing after-
the-fact analysis of issues in the period leading up to a problem. Tools
Working Around the Removal of XML APIs When can use an API to extract information from recording files."
Working With MicroProfile and Spring Apps
Unfortunately, JEP 320 removes some handy XML processing Flight Recorder is great in dev and test to manage the performance
classes as part of the removal of older Java EE and CORBA Mod- and reliability of the code. Distributed tracing is great to keep
ules, specifically JAX-WS (Java API for XML-Based Web Services) an eye on deployed microservices to see where bottlenecks are
and JAXB (Java Architecture for XML Binding), which are com- occurring across distributed microservices.
mon for reading and managing XML configuration files, among
other functions. 

Of course, you can build and/or refactor your apps to satisfy the
Java world's current YAML fetish if that's your thing, but if you
want to keep your applications as-is and use the latest JDK, the It’s truly amazing to see all of the
reference implementations of JAX-WS and JAXB are available as
Maven artifacts: community effort that has gone
• com.sun.xml.ws: jaxws-ri (JAX-WS, plus SAAJ and Web
into the JEP process and the
Services Metadata)
• com.sun.xml.bind : jaxb-ri (JAXB) Eclipse MicroProfile project.
There are also Maven artifacts for tools and APIs; check the JEP
320 doc for full details and links.

Use Flight Recorder and Distributed Tracing to Using MicroProfile to Manage Your Microservices
Collect and Analyze Telemetry in Your Microservices
MicroProfile has been rapidly evolving as a great way to manage
Two recent developments can greatly help you plan and manage
microservices with a few basic components that most micros-
deployments in the cloud. 
ervices need. It's an Eclipse project based on Java EE 8 and has
Distributed tracing can help manage and track microservice participation from major cloud vendors, IT organizations, and indi-
performance as well as the interactions between microser- viduals. You can get more information on the MicroProfile project,
vices. Distributed traces help manage and identify bottlenecks components, and participants at microprofile.io.  Also, check out
in your cloud applications, even if they're not all running on the the new MicroProfile starter page here.
same cloud, with minimal overhead and open-source visualiza-
tion offerings. Manage MicroProfile Configurations at Build and
Runtime
From OpenTracing.io: One of the great features of MicroProfile is the configuration
options. MicroProfile Config enables configurations externally
OpenTracing is comprised of an API specification, frameworks, and
and at runtime, meaning you can manage and even change some
libraries that have implemented the specification and documenta-
behaviors of an application based on the application environment
tion for the project. OpenTracing allows developers to add instru-
without any changes to the application code.
mentation to their application code using APIs that do not lock them
into any one particular product or vendor. You can use a pom.xml file to specify and transport configurations,

THE DZONE GUIDE TO JAVA PAGE 12 OF 38


DZONE.COM/GUIDES

or it can be specified or overridden at runtime. System properties code and testing, things can still go wrong in production. For those
are evaluated first, then environment variables, then the pom. rare cases, you want to have easy ways to shut down and redeploy
xml or project-defaults.yml files on the classpath. This enables not apps in a container environment. You also want to use similar
only flexible runtime environments but also easy testing of differ- features to help with scale by monitoring application load and
ent configuration options via ENV vars and system properties.  adjusting the number of containers available based on user needs. 

For example, distributed tracing is one of the key components Health checks are used to check if a specific microservice is
built into MicroProfile applications. To include Jaeger, an Open- healthy before engaging it via another microservice or pro-
Tracing implementation and visualization tool in your applica- cess. Fault tolerance is a way to manage what happens if a
tions, you just add this dependency to your pom.xml: microservice is failing inside a larger infrastructure of multiple
processes and microservices, and what automated action to take
<dependency>
<groupId>io.thorntail</groupId> based on predetermined rules. 
<artifactId>jaeger</artifactId>
</dependency> The good news is that, with MicroProfile, fault tolerance and
health checks can be built into your application with no changes
If you want to create a custom name for the service, you can add it to the code whatsoever. 
in the project-defaults.yml files on the classpath like this:
For example, to enable health checks in a MicroProfile app, just
swarm.jaeger.-jaeger-example
add this segment to the configuration section of the application's
pom.xml file:
You can also set the name as an environment variable:

<config>
export -jaeger-example
<thorntail-v2-health-check>
<path>/health</path>
If you're running a MicroProfile application with Java -jar , you
</thorntail-v2-health-check>
can also specify settings via parameters on the command line:
</config>

Java -jar -jaeger-example


Once fault tolerance and health checks are enabled, they can be
Some application platforms support environment variables monitored and automated responses to predetermined events can
for each deployment. Here's an example of Red Hat OpenShift be triggered with separate code. That code uses CDI to apply Retry-
Origin with Jaeger environment variables set for a deployed con- Policy, Fallback, BulkHead, and CircuitBreaker using annotations. 
tainer in a production environment:
For more details check out the Health Check project and the Fault
Tolerance project.

Conclusion
We live in interesting times! It's truly amazing to see all of the com-
munity effort that has gone into the JEP process and the Eclipse
MicroProfile project. Most of the work represents amazing innova-
tions in managing cloud-based microservices. If I've inspired you
or you have any questions, please let me know — I love hearing
from readers!

This enables major flexibility when building, testing, and de-


ploying your apps in multiple cloud environments with loosely
coupled services. BRIAN BENZ is a Senior Cloud Developer Advocate at
Microsoft, helping developers get the most out of Azure.
Before Joining Microsoft, he was a solution architect,
Building Fault Tolerance and Health Checks Into
consultant, developer, author, and presenter at IBM, Deloitte, and
Your Microservice Without Code other companies. LinkedIn Twitter
Even with all the facilities that I've shared so far for managing

THE DZONE GUIDE TO JAVA PAGE 13 OF 38


DZONE.COM/GUIDES

'-' WhiteSource

Reported Java
Open Source
Vulnerabilities More
Than Doubled in 2018

Find & Fix


Vulnerabilities in Your
Native Environment With
WhiteSource Bolt.

Get Free Tool

THE DZONE GUIDE TO JAVA PAGE 14 OF 38


DZONE.COM/GUIDES

The good news here is that the jump in the number of known
vulnerabilities is due to the open source community doing a stellar job
of finding and reporting these vulnerabilities, sharing their knowledge

Find and Fix Java Open to help keep us safe.

On the flip side, we know that hackers love known vulnerabilities,

Source Vulnerabilities scouring the NVD, security advisories, and other publicly available
resources for intel on how to exploit these highly reusable open-source
software components.

Your time is too valuable to be spent manually finding and fixing


vulnerabilities, so why let vulnerability management get in the way? To
Java is consistently one of the most popular languages in use today,
solve this, there are developer-friendly tools that can integrate into your
providing us with beloved projects including Android SDK, the Spring
native coding environment and harness the widest range of security
Framework, and more.
resources in order to keep you up to date on all vulnerabilities. This
However, despite its continued popularity, Java is witnessing a allows you to speed up remediations with suggested fixes, dramatically
spike in the number of published vulnerabilities in open source reducing the amount of work needed to stay secure, and — most
components. WhiteSource’s database shows that reported importantly — allowing you to focus on coding.
vulnerabilities for open source Java components more than doubled
in 2018, rising from 187 in 2017 to 446 in 2018, and posing a higher risk WRITTEN BY RAMI SASS
CEO & CO-FOUNDER, WHITESOURCE
to using them in our products.  

PARTNER SPOTLIGHT

WhiteSource
Helps you find and fix open source vulnerabilities in your code by fully integrating into your
software development lifecycle.

Category Application Security | Software Composition New Release Continuous Open Source? Yes
Analysis | DevOps | Secure Coding

Case Study Due to the sensitive regulatory environment Strengths


Siemens Healthineers work in, Siemens H. needed assurance • Largest Vulnerabilities Database: Continuously aggregates information
that they are remaining compliant and secure in their use of from multiple sources
open source components. • Comprehensive Coverage: Supports 200+ programming languages and 20+

“With open source software, usually the source code environments (incl. containers)

is available for all to see, including hackers,” explained • Pinpoint Accuracy: Proprietary algorithms guarantee no false positives
Code Clinic Lead, Neil Langmead. In order to avoid costly • Automated Workflow: Enforce policies automatically at all stages of the SDLC
mistakes that can result from vulnerable or risky open
• Easy Remediation: Pinpoints vulnerable methods affecting your products
source components being added to their products, Siemens
Healthineers turned to WhiteSource.
Notable Customers
Website
“We chose WhiteSource because of its ease of use, its excellent • Microsoft
whitesourcesoftware.com
data, and for the in-depth security vulnerability information that • Comcast
comes with the reporting engine.” With WhiteSource, Siemens • EllieMae Twitter
was offered the widest coverage of plugins and languages that • IGT @WhiteSourceSoft
they needed, as well as the continuous monitoring and policy • Spotify
Blog
enforcement safeguards they required in order to allow their
resources.whitesourcesoftware.com
team to code with confidence. Read more here

THE DZONE GUIDE TO JAVA PAGE 15 OF 38


DZONE.COM/GUIDES

QUICK VIEW

01. MicroProfile was born out of a need


to bring microservices-centric features

MicroProfile: What You to Java EE in order to accelerate the


growth of the ecosystem.

02. Technologies based on MicroProfile

Need to Know
include Open Tracing, JAX-RS, Fault
Tolerance, and more.

03. This article will review the history


of MicroProfile, its road map, the latest
advancements, and a review of several
MicroProfile features.

BY REZA RAHMAN
PRINCIPAL PROGRAM MANAGER FOR JAVA ON AZURE, MICROSOFT

MicroProfile is an open-source specification that brings a number This article is a brief look at the current state of MicroProfile.
of microservices-centric features to the Java EE ecosystem. It was This includes history, latest changes, road map, and a code
born out of the need to accelerate Java EE innovation at a time example-driven look at features.
when Oracle appeared to stop all Java EE 8 development. Micro-
Profile is already part of the Eclipse Foundation and very likely History
serves as an incubator to eventual standardization via Jakarta One of the key tenets of MicroProfile has been rapid release
EE proper (Oracle donated Java EE to the Eclipse Foundation as cycles, especially as compared with Java EE in recent years. The
Jakarta EE shortly after Java EE 8 was released). following chart shows the MicroProfile release history:

The graphic below shows current MicroProfile technologies. VERSION DATE CHANGES

MicroProfile is supported by major industry players like IBM,


Initial release with JAX-RS 2.0,
Red Hat, Oracle, Microsoft, Payara, and Tomitribe. Some notable September,
1.0 JSON-P 1.0, and CDI 1.2 (parts of
2016
MicroProfile API implementations include Payara, WebSphere Java EE 7).
Liberty, Quarkus, Helidon, KumuluzEE, and TomEE.
1.1 August, 2017 Addition of Configuration 1.0.
    
 
 

Addition of Health Check 1.0,


Metrics 1.0, Fault Tolerance 1.0,
 
  
September,
   1.2 and JWT Propagation 1.0.
2017

Updating to Configuration 1.1.


   
  

THE DZONE GUIDE TO JAVA PAGE 16 OF 38


DZONE.COM/GUIDES

VERSION DATE CHANGES Roadmap


The likely contents of MicroProfile 3.0 are shown in the graphic
Addition of Open Tracing 1.0,
below. It is due to be released in June 2019. It should contain
Open API 1.0, and REST Client 1.0.
1.3 January, 2018 major updates to Metrics as well as Health Check. Outside of the
Updating to Metrics 1.1 and umbrella release, Reactive Streams Operators will have a minor
Configuration 1.2.
release when GraphQL, Long Running Actions (LRA), and Micro-
Profile Concurrency are projected to have their initial release.
Updating to Open Tracing 1.1,
REST Client 1.1, Fault Tolerance Once these APIs mature, it is likely they will be included in the
1.4 June, 2018
1.1, JWT Propagation 1.1, and umbrella release.
Configuration 1.3.
‹‚Š

Updating to CDI 2.0, JAX-RS 2.1, 





 ‡
 
2.0 June, 2018 and JSON-P 1.1 as well as adding




JSON-B 1.0 (parts of Java EE 8).
 ƒ ……
 
  …†
   …Ž
2.1 October, 2018 Updating to Open Tracing 1.2.

 
 „

‰ 
Updating to Open Tracing 1.3,
2.2. February, 2019 Open API 1.1., REST client 1.2,
Š  Š€
and Fault Tolerance 2.0. ˆ
 


 ­€‚ €‚ ­Œ €€
Most Recent Developments
As the version increment indicates, MicroProfile 2.2 is mostly a
minor update of interest to existing adopters. Below are some The topics currently actively under discussion in the MicroPro-
significant changes: file forums include the following.

• Open Tracing 1.3 improves integration with MicroProfile • Long Running Actions (LRA)

Rest Clients. • Reactive Messaging

• GraphQL
• Open API 1.1 adds support for the JAX-RS 2.1 PATCH method
• Concurrency
and improves integration with MicroProfile Rest Clients.
• Reactive Relational Database Access
• Rest Client 1.2 improves support for HTTP headers, • Event Data
especially via the new @ClientHeaderParam annotation. • Service Meshes

• Fault Tolerance 2.0 was upgraded to CDI 2.0. In


addition, the @Asynchronous annotation now supports MicroProfile APIs
CompletionStage. The following is a high-level overview of the current MicroProfile
APIs with brief code examples.

Aside from the umbrella release, Reactive Streams Operators 1.0


OPEN API
was released as a standalone feature. This is a lower level SPI- MicroProfile Open API provides a JAX-RS binding for the Open
style technology that will likely be incorporated into other parts
API specification. The Open API specification is an API description
of MicroProfile going forward.
format for REST. One way to think of it is that it is WSDL (Web

A beta release of the MicroProfile Starter was just made Services Description Language) for REST. The feature is enabled
available. This is an online project generation tool that makes it by default in all MicroProfile applications and automatically
a lot easier to get started with MicroProfile projects. generates API documentation for JAX-RS endpoints.

THE DZONE GUIDE TO JAVA PAGE 17 OF 38


DZONE.COM/GUIDES

@GET cated user principal. The code above checks that the principal
@Operation(description="Get all current includes the "admin" role before allowing access.
memberships")
@APIResponses({ Configuration Java EE has always included the ability to con-
   @APIResponse(responseCode="200", figure applications. However, such configuration is mostly static
       description="Successful, returning
after deployment. In a cloud environment, it should be possible
memberships"),
to modify configuration values from outside an application
   ... at runtime so that the application itself does not need to be
}) repackaged. MicroProfile Configuration makes it possible to
public List<Membership> getAllMemberships() {
read configuration values from various sources such as property
files, system properties and environment variables. It is even
The Open API @Operation and @APIResponses annotations
possible to read configuration values from sources such as the
provide overrides for what MicroProfile would automatically
secure configuration store of the cloud provider (such as the
generate by scanning JAX-RS annotations.
Azure Key Vault). The client code for MicroProfile configuration
is quite simple:
Open Tracing
MicroProfile Open Tracing provides a Java binding for the Open @Inject
Tracing specification. Tracing the flow of a request in a distribut- @ConfigProperty(name="host.name",
defaultValue="localhost")
ed environment has always been challenging. The Open Tracing
private String hostname;
specification solves this problem by providing a standard for
instrumenting microservices for distributed tracing in a technol- The @ConfigProperty annotation injects the "host.name"
ogy agnostic manner. One way to think of the concept is that it value from somewhere in the environment. If it is not found, the
is a stack trace for REST services. Tools that support the concept default value of "localhost" is injected.
include Jaeger and Zipkin.

@GET
Rest Client
@Path("{id}") JAX-RS provides a powerful client API, but it can be hard to
use and not really type safe. Several JAX-RS implementations
@Traced(operationName="GetMembershipById",
support the ability to take an interface definition (typically for a
value=true)
JAX-RS endpoint) and create a JAX-RS client proxy from it. This
public Membership getMembership(
   @NotNull @PathParam(value="id") int id) {
is very similar to how JAX-WS/SOAP clients work. MicroProfile
Rest Client standardizes this capability:
The Open Tracing @Traced annotation in the code example as-
String apiUrl = "http://localhost:9080/
signs a more meaningful name to the method being traced and
movieReviewService";
specifies that call values should be traced. MovieReviewService reviewService =   
   RestClientBuilder.newBuilder()
JWT Propagation MicroProfile JWT Propagation provides a            .baseUrl(apiUrl)
Java binding for the JWT (JSON Web Token) specification. REST            .build(MovieReviewService.class);
services are usually stateless, and any security state associated Review review = new Review(3 /*stars*/, "Good

with a client is sent to the target service on every request in or- Movie.");
reviewService.submitReview(movie, review);
der to allow services to re-create a security context for the caller
and perform both authentication and authorization checks. This The MovieReviewService in the code example is a generated
is basically what OAuth2, OpenID Connect, and JWT do. It could proxy client (from a JAX-RS server-side endpoint) that is hydrat-
be thought of as SAML for REST.
ed using the RestClientBuilder factory.

@GET
Health Check Health checks probe the state of a computing
@RolesAllowed({"admin"})
node from another machine (such as the Azure Kubernetes
public List<Membership> getAllMemberships() {
Service controller) in order to facilitate things like monitoring
MicroProfile detects the presence of a JWT token in the inbound dashboards and auto-restarts/self-healing. MicroProfile Health
client request and translates it under the hood to an authenti- Check allows the publishing of health data in a standard way

THE DZONE GUIDE TO JAVA PAGE 18 OF 38


DZONE.COM/GUIDES

using a convenient API: mon failure-handling patterns via annotations. Without these
annotations, you would wind up with convoluted if-then-else
@Health
@ApplicationScoped statements in your business logic. Retries, timeouts, bulkheads,
fallbacks, and circuit breakers are some of the common patterns
public class CheckDiskSpace implements HealthCheck
that the API supports.
{
   ... @GET
   public HealthCheckResponse call() { @Path("{id}")
       ...
@CircuitBreaker(failOn=RuntimeException.class,
   }
requestVolumeThreshold=1,
}
   failureRatio=1, delay=10, delayUnit=ChronoUnit.
SECONDS)
The MicroProfile @Health annotation publishes health informa-
@Timeout(value=3, unit=ChronoUnit.SECONDS)
tion using a standard format at a standard URL. The returned
@Bulkhead(2)
HealthCheckResponse includes a field to indicate if a service
public Membership getMembership(
is up or down. You can also add arbitrary metadata that might    @NotNull @PathParam(value = "id") int id) {
be helpful to understanding service health (such as perhaps
remaining free space in our case). There are simple factories in In the code example, the @Timeout annotation causes the
the API to easily create and populate a HealthCheckResponse . method call to fail unless it executes within three seconds. The @
Bulkhead annotation limits concurrent requests to two. Finally,

Metrics the @CircuitBreaker annotation specifies that the method


Similar to health checks, Metrics publish common statistics in a should not be accessed if an unchecked exception occurs. Once
standard location and format. This information is collected and a failure occurs, the method can be accessed again after 10 sec-
used by distributed metrics registries and consoles such as Pro- onds. Other annotations in the API include @Retry , @Fallback ,
metheus/Kubernetes. MicroProfile Metrics publish a required and @Asynchronous .
base set of metrics (such as CPU and memory) and some vendor
specific metrics (such as thread pool usage information). You Summary
can also add application specific metrics. As you can see, MicroProfile fills an important gap by providing
some cool features that are perhaps even useful outside of micro-
@GET
services. I would encourage you to start trying them out using one
@Timed(name="get_all_memberships_time",
absolute=true, of the many good MicroProfile implementations. Once you have
   unit=MetricUnits.MICROSECONDS) tried things out, a very useful thing to do is get engaged with the
public List<Membership> getAllMemberships() {
highly active and responsive MicroProfile community!
...
@POST
Resources
@Counted(name="memberships_created", absolute=true,
monotonic=true) • Home page: microprofile.io
public Membership createMembership( • Starter: start.microprofile.io
   ...
• Forum: groups.google.com/forum/#!forum/microprofile
   Membership membership){

In the code example, two application specific metrics are added. REZA RAHMAN is a Principal Program Manager for Java on
@Timed measures the average time required to get all member- Azure at Microsoft. He works to make sure Java developers
are first class citizens at Microsoft, and Microsoft is a first-
ships while @Counted measures how many new memberships
class citizen of the Java ecosystem. Reza has long been a frequent
were added. Other such MicroProfile Metrics annotations speaker at Java User Groups and conferences worldwide including
include @Gauge and @Metered. JavaOne and Devoxx. He has been working with Java EE technology
since its inception, developing on almost every major application
platform ranging from Tomcat to JBoss, GlassFish, WebSphere, and
Fault Tolerance WebLogic. Reza has developed enterprise systems for well-known
Microservices, especially running on the cloud, are inherently companies like eBay, Motorola, Comcast, Nokia, Prudential, Guardian
unreliable. MicroProfile Fault Tolerance makes dealing with Life, USAA, Independence Blue Cross, Anthem, CapitalOne, and AAA
using Java EE and Spring. LinkedIn Twitter
this unreliability a little easier by standardizing a set of com-

THE DZONE GUIDE TO JAVA PAGE 19 OF 38


DZONE.COM/GUIDES

QUICK VIEW

01. Java has new releases every six


months instead of releasing every
three years.

02. Most releases will only be


supported for six months until the next
release. Every three years a release will

Beyond Java 8
be a LTS (Long Term Support) release,
which will be supported for at least
three years.

03. Oracle now releases two different


JDKs with separate licenses, one
commercial and one free, with different
approaches to updates and support.

04. Oracle has added all features from


their JDK to OpenJDK, so now there’s
no functional difference. This gives you
a greater choice of JDKs from a range
of vendors.
BY TRISHA GEE
DEVELOPER ADVOCATE AT JETBRAINS

If recent surveys are to be believed (including DZone read- for our language to evolve much faster than every three years.
ers, see page 3), most developers are still using Java 8 for the The new release cadence means that instead of getting huge,
majority of their application. Before Java 8, uptake of a new feature-packed releases dumped on us every few years, with
version of Java was quite slow, particularly in enterprises where the associated risks of such a big upgrade, we get much smaller
it can be difficult to get a new version of Java accepted for releases on predictable dates. These releases have far fewer
production. Java 8, with the introduction of lambda expressions features of course, but there are several benefits to this model:
and streams, was an appealing choice for many developers.
1. Easier to plan for. The predictable release cadence makes
The adoption of microservices, continuous delivery practices,
it easier not only for language developers to plan for, but
and better automated testing also makes it easier to use a new
also to plan our upgrades.
version of a language with far less risk than in the past.
2. Higher quality. Frequent releases mean that if a feature
So, given this, why is it that developers are "stuck" on Java 8, isn't ready for this version of Java, it won't be long until
despite the fact that since Java 9 we now have two releases of the next release. This means far less pressure on language
Java a year? Java 12 is now the most recent version, and yet few developers to rush to complete something, and therefore
people have made the leap to 9, 10, 11 or 12. higher quality releases.

3. Steady supply of new features. Instead of three years of


As you might expect, the answer is "it's complicated". There
potential stagnation followed by a huge upgrade, we're
have been a number of different changes since Java 8 was re-
getting regular updates of language features, garbage
leased that may make organizations wary of upgrading.
collector changes, and performance improvements.

Six Monthly Release Cadence The potential downside of moving to such a rapid release
Since Java 9 (released September 2017), Oracle has been cadence is that many organizations simply can't keep up with
releasing a new JDK every six months, in March and Septem- upgrading every six months. This has been fully considered, not
ber every year. In a continuous delivery world, it makes sense least of all because Oracle too will be impacted by this.

THE DZONE GUIDE TO JAVA PAGE 20 OF 38


DZONE.COM/GUIDES

Long Term Support Releases This explains this pattern of adoption — generally people will
Oracle doesn't want to support every release for three (or more) not be on Java 9 or 10. If they were using it at any stage, they
years the way they used to support the previous releases. This should have moved on to at least Java 11.
would be a huge cost to them.
With the combination of short-term releases that one should
 migrate from as soon as a new release is out, and long-term re-

leases that are supported for at least three years, there are now

 potentially two main approaches to upgrading:


 1. Upgrade to every release as it comes out. This means


 adopting the latest version of Java every six months.

The benefit is that you'll get new features as soon as

they're available, but this approach will probably only
       
suit those who are used to upgrading their technology
Figure 1: If Oracle supported every six-month release for three stack this quickly.
years, at some point in 2020 they'll be supporting six different
versions of the language! 2. Upgrade to just the long-term support releases. This
is a more familiar cadence for us Java developers. This
Instead, they've said one release every three years will be a Long
gives us the downside of a Big Bang release every three
Term Support release, which they will support for about three
years, but we have more time to evaluate the risks of
years. Java 8 was an LTS, the current LTS is Java 11, and presum-
such an upgrade.
ably the next will be 17.

There's a potential middle ground here: use the LTS release in


 production, but make sure your application is running against

each six-month release in CI. Doing this should minimize the

 risk of a big bang upgrade while maintaining the required
 stability in production.







Oracle doesn't want to


       

Figure 2: Oracle selects a release every three years to provide


long term support and updates for, and the other releases only
live for six months. support every release for
The intermediate releases, though, will not be supported once
the next release is out. This means that Java 9 was replaced by
three (or more) years the
Java 10, and when Java 11 was released it superseded Java 10.
way they used to support the
previous releases. This would
be a huge cost to them.

Figure 3: When developers upgrade from Java 8, they generally License Changes
upgrade all the way to Java 11. There is a caveat to these long-term support releases. Oracle's

THE DZONE GUIDE TO JAVA PAGE 21 OF 38


DZONE.COM/GUIDES

position is that if you want support and updates for three years, OpenJDK build from AdoptOpenJDK. This JDK is compatible
you should be prepared to pay for them. So, if you want to use with the Oracle JDK, you can get builds for the major operating
an LTS and get updates for three years, you will need to pay systems and platforms, you can choose from two different JVMs
Oracle for their commercial JDK. (Hotspot and OpenJ9), they have committed to providing builds
for the LTS releases for at least 4 years, and you have the option
However, Oracle recognizes that not everyone wants to do
to purchase commercial support.
this, and that many people want to work in an open-source-
friendly way, so they now have two versions of their JDK (both Since this topic can be quite complex, I highly recommend
functionally the same) with two different licenses. They have reading the Java Is Still Free document produced by the Java
their commercial JDK, which is free to use in development and Champions for more in depth information.
testing but you need to pay to use it in production; and they
have a zero cost OpenJDK build. The latter has an open source
GPLv2+CPE licence, but will only be updated within six months In Summary
of this release lifespan. Lots of things have changed since Java 8's release: we get
releases every six months; the licensing, update, and support
models have changed; and where we get our JDK from may
have changed. On top of that, there were language changes,
including the major changes that went into Java 9.

In a continuous delivery While all of these changes may seem daunting, their goal is to
provide high quality, frequent, and predictable updates to one

world, it makes sense for of the most popular languages in the world, in a way that is
sustainable to those who work on and support the language.

our language to evolve It's worth understanding the impact these changes may have
on your application and organization, because working out how
much faster than every to embrace them will ultimately allow you to make use of the
improvements that have already gone into the language since
three years. Java 8, and will continue to evolve and improve the language
every six months.

This is actually good from a competition point of view. Oracle


has contributed everything from their JDK back to OpenJDK,
even the features that used to be commercial features like Java
Flight Recorder and Java Mission Control. So, any JDK built from
TRISHA GEE has developed Java applications for a
OpenJDK, which is pretty much everyone's JDK, will have all
range of industries, including finance, manufacturing,
the features you're used to using, and maybe even some you
software, and non-profit, for companies of all
haven't used before. sizes. She has expertise in Java high-performance systems, is
passionate about enabling developer productivity, and dabbles
There are plenty of other vendors offering JDKs. Many are free, with Open Source development. Trisha is a leader of the Sevilla
some will be updated or supported for different lengths of Java User Group and a Java Champion, she believes healthy

time from the Oracle JDKs. This document lists these different communities and sharing ideas help us to learn from mistakes
and build on successes. As a Developer Advocate for JetBrains,
options, separating those that are free to download and use
she gets to share all the interesting things she’s constantly
from those that have a commercial model. If this all seems a discovering. LinkedIn Twitter
little overwhelming, a good starting point is to download your

THE DZONE GUIDE TO JAVA PAGE 22 OF 38


DZONE.COM/GUIDES

QUICK VIEW

01. The most important elements of

Executive Insights on
the ecosystem continue to be Oracle,
the Eclipse Foundation, and the
members of the community.

the Current State of the


02. IBM, Red Hat, Pivotal, Amazon, and
many others have stepped up to make
a significant impact on Java beyond
Oracle.

Java Ecosystem 03. The most significant change in the


past year has been the abandonment
of the JRE as many enterprises are
scrambling to move to another JRE.

BY TOM SMITH
RESEARCH ANALYST, DZONE

To understand the current and future state of the Java frameworks, and toolsets. Java is available on all laptops,
Ecosystem, we reached out to our community for their insights. desktops, servers, cloud systems, and some embedded devices
Unlike other topics like containers and security, there are far and mobile phones. This is invaluable since code is compatible
fewer people willing to share their thoughts on the current and doesn’t need to be continually recompiled or changed.
and future state of Java. This appears to be a function of its
maturity relative to other technologies. 2. The most important players in the ecosystems continue to
be Oracle and the community with many significant members
We are grateful to our three contributors who all have of the community stepping up. IBM and Red Hat have made
significant experience with Java: significant contributions in the language space while Amazon
will have a significant impact through its default choices and
• Anders Wallgren
the new Corretto OpenJDK distribution. Pivotal is also crucial
CTO, Electric Cloud
thanks to frameworks like Spring and Spring Boot, while the
• Erik Costlow Eclipse Foundation maintains Java EE.
Principal Product Evangelist, Contrast Security

• Mark Little
V.P. Middleware Engineering, Red Hat
Having to change from the
JRE hurts adoption. It’s not
Key Findings
1. The most important elements of the Java ecosystem are
just a question of the language,
Oracle, the Eclipse Foundation, and the members of the
it’s also the tooling and the
community that ensure pervasiveness and compatibility.
There is huge community adoption, low barrier to entry, nice frameworks.

THE DZONE GUIDE TO JAVA PAGE 23 OF 38


DZONE.COM/GUIDES

3. The most significant changes in the past year is the investment they’ve made in Java. Languages are hard to change.
abandonment of the JRE. It overshadows all of the good things It will be interesting to see if other languages begin to use the
like the consistent feature release cadence. This is delaying the Java Virtual Machine. There have been niche solutions for this in
adoption of Java past Java 8. There’s a lot of good stuff in Java the JRE like JRuby, Nashorn, and Jython.
11, but people are delaying adoption of the new features by six
months to a year to move to another JRE.

4. Things Oracle and the community can do to encourage As long as large enterprises are
organizations to upgrade past Java 8 is to make it easy to do
so. Promote Adopt OpenJDK, keep coming out with compelling
able to evolve beyond Java 8
improvements that make developers lives simpler and easier,
and keep licensing straightforward.
and Java becomes more cloud-
Adopt OpenJDK is a one-stop shop for developers to get access
native, it will continue to be a
to different JDK builds from different vendors. The community predominant language.
helps people who are having problems moving from version 8 to
later versions.

8. Developers need to examine the reasons they are considering


Having to change from the JRE hurts adoption. It’s not just
a new language. Look at the stability of Java over the long
a question of the language, it’s also the tooling and the
term and the breadth and depth of the ecosystem. To deliver
frameworks.
enterprise software you need tools, CI/CD, test suites, class
libraries, and a suite of additional capabilities. It will take years
Java users need compelling reasons to move beyond Oracle to
for a new language to achieve the richness of Java.
the public version. Amazon Corretto’s Java 8 is now publicly
supported for four years beyond Java 8. The strongest
Java in the enterprise is not going anywhere because of the
encouragement will be from the cloud providers. When Java
existing code that’s in place. It works, it scales, and people
X becomes the default in major cloud providers, people will
know how to run and operate it. What you are able to get out
choose Java X.
of the JRE with regards to the instrumentation, analysis, and
operational insights during runtime is not available with other
5. Java continues to be used everywhere and we can expect
languages. The ability to get introspection while running are
it to see greater adoption in the cloud and IoT. Java runtime,
very interesting in the application world where there is a desire
enterprise Java class libraries, and application servers will be
for things to run a long time.
tuned to better fit into new environments.

Java is a blue collar language for developers trying to solve real


6. The most significant challenges with the Java ecosystem
business problems. As such, know the problem you are trying
today are size and complexity. There’s a lot going on and it can
to solve. Java’s success can be attributed to the fact it has
be difficult to know where to go in the community to get the help
removed distractions like memory management and certain
you need. The most common problem are the modularity issues
aspects of security. When reading code you can see the problem
above Java 8. If an application needs work to move up, people
being solved.
don’t know what’s required or it may require an obscure rework
on a third-party library that no one understands. There needs to
be a compelling reason to upgrade or it needs to become easier. TOM SMITH is a Research Analyst at Devada who excels
at gathering insights from analytics—both quantitative
7. As long as large enterprises are able to evolve beyond Java and qualitative—to drive business results. His passion
is sharing information of value to help people succeed. In his spare
8 and Java becomes more cloud-native, it will continue to be a
time, you can find him either eating at Chipotle or working out at the
predominant language. Companies are unable to throw away the gym. LinkedIn - Twitter

THE DZONE GUIDE TO JAVA PAGE 24 OF 38


DZONE.COM/GUIDES

Java Solutions Directory


Java gets even greater when you have the right tools to back you up. This directory contains libraries, frameworks,
IDEs, and more to help you with everything from database connection to release automation, from code review to
application monitoring, from microservice architectures to memory management. Amp up your Java development
with these solutions to make your life easier and your application more powerful.

Company Product Product Type Open Source? Website

Adzerk Hoplon ClojureScript web framework Open source hoplon.io

In-memory data grid (JCache-


Alachisoft NCache Open source alachisoft.com/ncache
compliant)

Amazon Web Elastic container service w/Docker Free tier


AWS ECS aws.amazon.com/ecs
Services support available

AngularFaces AngularFaces 2.1 AngularJS plus JSF Open source angularfaces.net

Parser generator for creating


ANTLR ANTLR v3 Open source antlr3.org
compilers & related tools

Apache Software Build automation (process-


Apache Ant Open source ant.apache.org
Foundation agnostic: specify targets & tasks)

Apache Software Java implementation of enteprise


Apache Camel Open source camel.apache.org
Foundation integration patterns

Apache Software commons.apache.org/


Apache Commons Massive Java package collection Open source
Foundation components

Apache Software Apache Commons commons.apache.org/


Database connection pooling Open source
Foundation DBCP proper/commons-dbcp

Apache Software commons.apache.org/


Apache Commons IO Utilities for Java I/O Open source
Foundation proper/commons-io

Apache Software Java services framework w/JAX-WS


Apache CXF Open source cxf.apache.org
Foundation & JAX-RS support

Portable CDI extensions (bean


Apache Software validation, JSF enhancements,
Apache DeltaSpike Open source deltaspike.apache.org
Foundation invocation controls, transactions
contexts)

Apache Software
Apache Ignite In-memory data grid Open source ignite.apache.org
Foundation

Apache Software Dependency mgmt w/strong Ant


Apache Ivy Open source ant.apache.org/ivy
Foundation integration

THE DZONE GUIDE TO JAVA PAGE 25 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Apache Software Distributed pub-sub message


Apache Kafka Open source kafka.apache.org
Foundation broker

Apache Software
Apache Log4j 2 Logging for Java Open source logging.apache.org/log4j/2.x
Foundation

Apache Software
Apache Lucene Search engine in Java Open source lucene.apache.org/core
Foundation

Build automation (opinionated,


Apache Software plugin-happy, higher-level build
Apache Maven Open source maven.apache.org
Foundation phases, dependency mgmt/
resolution)

Apache Software
Apache Mesos Distributed systems kernel Open source mesos.apache.org
Foundation

Apache Software JSF plus additional UI widgets,


Apache MyFaces Open source myfaces.apache.org
Foundation extensions, & integrations

Apache Software Natural language processing


Apache OpenNLP Open source opennlp.apache.org
Foundation machine learning toolkit

Apache Software Microsoft document processing for


Apache POI Open source poi.apache.org
Foundation Java

Apache Software Java security framework (authen/


Apache Shiro Open source shiro.apache.org
Foundation author, crypto, session mgmt)

Apache Software
Apache Struts Web framework (servlet & MVC) Open source struts.apache.org
Foundation

Web framework (POJOs, live class


Apache Software
Apache Tapestry reloading, opinionated, light Open source tapestry.apache.org
Foundation
HttpSessions)

Apache Software Servlet container & web server


Apache Tomcat Open source tomcat.apache.org
Foundation (JSP, EL, Websocket)

Apache Software Simple web app framework (pure


Apache Wicket Open source wicket.apache.org
Foundation Java & HTML w/Ajax output)

Apache Software
Apache Xerces2 XML parser for Java Open source xerces.apache.org/xerces2-j
Foundation

Apache Software
Derby Java SQL database engine Open source db.apache.org/derby
Foundation

Apache Software Server-side Java web templating


FreeMarker Open source freemarker.apache.org
Foundation (static & dynamic) 

Apache Software Apache Tomcat & Java EE features


Apache TomEE Open source tomee.apache.org
Foundation (CDI, EJB, JPA, JSF, JSP)

THE DZONE GUIDE TO JAVA PAGE 26 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

AppDynamics AppDynamics APM w/Java agent 15 days appdynamics.com

Java assertion framework (for joel-costigliola.github.io/


AssertJ AssertJ Open source
verification & debugging) assertj

atlassian.com/software/
Atlassian Clover Code coverage analysis tool Open source
clover

Free tier
Atomist Atomist Self-service software delivery atomist.com
available

Show performance issues caused


Azul Systems jHiccup Open source azul.com/jhiccup
by JVM (as opposed to app code)

Free tier
Azul Systems Zing JVM w/unique pauseless GC azul.com/products/zing
available

Azul Systems Zulu Enterprise-grade OpenJDK build Open source azul.com/products/zulu

bmc.com/it-solutions/
BMC TrueSight Infrastructure monitoring 14 days
truesight.html

Bouncy Castle Bouncy Castle Java & C# cryptography libraries Open source bouncycastle.org

CA Application ca.com/us/products/ca-
CA Technologies Performance APM w/Java agent 30 days application-performance-
Management management.html 

Presentation model framework


github.com/canoo/dolphin-
Canoo Dolphin Platform (multiple views for the same MVC Open source
platform
group)

Data & application integration


Cask Cask Open source cask.co
platform

Catchpoint Catchpoint APM w/Java agent 14 days catchpoint.com

Available by
CData CData Data integration & connectivity cdata.com
request

Charlie Hubbard Flexjson JSON serialization Open source flexjson.sourceforge.net

Automated check against Java


CheckStyle CheckStyle Open source checkstyle.sourceforge.net
coding standards

Infrastructure automation/
Chef Software Chef Open source chef.io/chef
configuration mgmt

Java & Scala APM w/many Free tier


Chronon Systems DripStat APM dripstat.com/products/apm
framework integrations available

THE DZONE GUIDE TO JAVA PAGE 27 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Cloudbees Jenkins CI server Open source jenkins.io

UI tests in Java (Selenium


Codeborne Selenide Open source selenide.org
WebDriver)

Couchbase Couchbase Document-oriented DBMS Open source couchbase.com

Cucumber Cucumber BDD framework w/Java version Open source cucumber.io

Open source
Data Geekery jOOQ Non-ORM SQL in Java version jooq.org
available

Extension of Java 8 lambda


Data Geekery jOOλ support (tuples, more parameters, Open source github.com/jOOQ/jOOL
sequential & ordered streams)

Docker Docker Containerization platform Open source docker.com

Open source
Draios Sysdig Container monitoring versions sysdig.com
available

Dynatrace Application
Dynatrace APM 15 days dynatrace.com
Monitoring

Unit testing framework (mocks


EasyMock EasyMock Open source easymock.org
Java objects)

Eclipse Foundation Eclipse IDE (plugin-happy) Open source eclipse.org

IDE (workspace isolation, cloud


Eclipse Foundation Eclipse Che Open source eclipse.org/che
hosting)

Eclipse Foundation Eclipse Collections Java Collections framework Open source eclipse.org/collections

Eclipse Foundation EclipseLink JPA & MOXx (JAXB) implementation Open source eclipse.org/eclipselink

Servlet engine & HTTP server (w/


Eclipse Foundation Jetty Open source eclipse.org/jetty
non-HTTP protocols)

Eclipse Foundation SWT Java UI widget toolkit Open source eclipse.org/swt

ej-technologies.com/
Free tier
EJ Technologies JProfiler Java profiling products/jprofiler/overview.
available
html

THE DZONE GUIDE TO JAVA PAGE 28 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Distributed search & analytics


Elastic ElasticSearch Open source elastic.co
engine

Free version
Electric Cloud ElectricFlow Release automation electric-cloud.com
available

Elide Elide JSON <- JPA web service library Open source elide.io

Demo
IIoT platform w/Java SDK (on Cloud
GE Digital Predix available by ge.com/digital/iiot-platform
Foundry)
request

genuitec.com/products/
Genuitec MyEclipse IDE (Java EE & web) 30 days
myeclipse

Google Web Toolkit


Google Java -> Ajax  Open source gwtproject.org
(GWT)

Google GSON JSON serialization Open source github.com/google/gson

Java libraries from Google


Google Guava (collections, caching, concurrency, Open source github.com/google/guava
annotations, I/O)

Google Guice Dependency injection framework Open source github.com/google/guice

Build automation (Groovy-based


Gradle Gradle Open source gradle.org
scripting of task DAGs)

Groovy web framework (like Ruby


The Grails Project Grails Open source grails.org
on Rails)

In-memory data grid (Apache


Free tier
GridGain Systems GridGain Ignite & enterprise mgmt, security, gridgain.com
available
monitoring)

H2 H2 Java SQL database engine Open source h2database.com

Java rapid enterprise app


Haulmont CUBA Platform Open source cuba-platform.com
development framework

Distibuted in-memory data grid (w/


Hazelcast Hazelcast IMDG Open source hazelcast.org
JCache implementation)

HyperGrid HyperForm Container composition platform 30 days hypergrid.com

Free tier
IBM IBM Cloud PaaS w/extensive Java support ibm.com/cloud
available

WebSphere ibm.com/cloud/websphere-
IBM Java application server 60 days
Application Server application-platform

THE DZONE GUIDE TO JAVA PAGE 29 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

icesoft.org/java/projects/
IceSoft IceFaces JSF framework Open source
ICEfaces/overview.jsf

Informatica Informatica Data integration & mgmt 30 days informatica.com

JVM APM w/production debugging Available by


Integral GmbH FusionReactor fusion-reactor.com
& crash protection request

Isomorphic Java -> Ajax w/rapid dev tools, UI smartclient.com/product/


Smart GWT 60 days
Software components, multi-device smartgwt.jsp

Open-source
iText Group iText 7 PDF manipulation from Java version itextpdf.com
available

github.com/FasterXML/
Jackson Jackson JSON processing Open source
jackson

Open-source
Jahia Solutions Enterprise CMS/portal (Jackrabbit
Jahia Platform version jahia.com
Group compliant)
available

janino-compiler.github.io/
Janino Compiler JANINO Lightweight Java compiler Open source
janino

Available by
jClarity Censum GC log analysis jclarity.com/censum
request

Java-focused APM w/machine Available by


jClarity Illuminate jclarity.com/illuminate
learning & autosummarization request

Java Decompiler JD Java decompiler Open source jd.benow.ca

Jdbi Jdbi SQL library for Java Open source jdbi.org

XML in Java (w/DOM & SAX


JDOM JDOM Open source jdom.org
integration)

Available by
Jelastic Jelastic Multi-cloud PaaS (w/Java support) jelastic.com
request

Free 10-user
JetBrains Upsource Code review jetbrains.com/upsource
plan

Open-source
JetBrains IntelliJ IDEA IDE version jetbrains.com/idea
available
30 days for on-
JFrog Artifactory Binary/artifact repository manager prem, 14 days jfrog.com/artifactory
for cloud
Open-source
Package hosting & distribution
JFrog Bintray version bintray.com
infrastructure
available

THE DZONE GUIDE TO JAVA PAGE 30 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Reporting, dashboard, analytics, & Available by


Jinfonet JReport jinfonet.com
BI for Java request

JMS Adapters for .NET jnbridge.com/software/jms-


JNBridge JMS Integration & .NET or BizTalk 30 days
or BizTalk by JNBridge adapter-for-biztalk/overview

jnbridge.com/software/
JNBridge JNBridgePro Java & .NET interoperability 30 days
jnbridgepro/overview

Joda Joda-Time Low-level Java libraries Open source joda.org/joda-time

Container-native infrastructure w/
Joyent Triton Open source joyent.com/triton/compute
Java images

Unit testing framework (mocks


JUnit JUnit 5 Open source junit.org/junit5
Java objects)

Liferay Digital
Liferay Enterprise CMS/portal 30 days liferay.com
Experience Platform

Java implementation of Actor


Lightbend Akka Open source akka.io
Model

Reactive microservices framework lightbend.com/lagom-


Lightbend Lagom Open source
(Java, Scala) framework

Dev & prod suite for reactive JVM Demo


Lightbend Reactive lightbend.com/products/
Lightbend applications (Akka, Play, Lagom, available by
Platform reactive-platform
Spark) request

Java & Scala web framework


Lightbend Play Open source playframework.com
(stateless, async, built on Akka)

Lightbend Spray REST for Scala/Akka Open source spray.io

The Linux
Kubernetes Container orchestration Open source kubernetes.io
Foundation

Machinery for JDBC connection & statement


CP3O Open source mchange.com/projects/c3p0
Change pooling

Manage, monitor, & troubleshoot Available by


ManageCat ManageCat managecat.com
Apache Tomcat request

Multi-model enterprise Free tier


MarkLogic MarkLogic 8 marklogic.com
NoSQLÊdatabase available

Available by mendix.com/application-
Mendix Mendix Platform Enterprise aPaaS
request platform-as-a-service

COBOL accessibility from Java


microfocus.com/products/
Microfocus Visual COBOL (w/COBOL -> Java bytecode 30 days
visual-cobol
compilation)

THE DZONE GUIDE TO JAVA PAGE 31 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Unit testing framework (mocks


Mockito Mockito Open source mockito.org
Java objects)

MongoDB MongoDB Document-oriented DBMS Open source mongodb.com

developer.mozilla.org/en-
JavaScript implemention in Java
Mozilla Rhino Open source US/docs/Mozilla/Projects/
(for embedded JS)
Rhino

Available by mulesoft.com/platform/
MuleSoft AnyPoint Platform Hybrid integration platform
request enterprise-integration

MyBatis MyBatis JDBC persistence framework Open source mybatis.org/mybatis-3

DSL for multiple query targets (JPA,


Mysema Querydsl JDO, SQL, Lucene, MongoDB, Java Open source querydsl.com
Collections)

Free tiers
Nastel AutoPilot APM nastel.com
available

Netflix Hystrix Latency & fault tolerance library Open source github.com/Netflix/hystrix

Netflix Ribbon RPC library w/load balancing Open source github.com/Netflix/ribbon

Reactive extension for JVM github.com/ReactiveX/


Netflix RxJava Open source
(extends observer pattern) RxJava

Event-driven, non-blocking JVM


The Netty Project Netty framework for protocol clients & Open source netty.io
servers
Demo
New Relic New Relic APM w/Java agent available by newrelic.com
request
Open-source
Web server, load balancer, reverse
NGINX NGINX version nginx.com
proxy
available

Ninja Framework Ninja Framework Full-stack web framework for Java Open source ninjaframework.org

Demo
Structured & rich content mgmt
Nuxeo Nuxeo Platform available by nuxeo.com
platform
request

Object Refinery
JFreeChart Java charting library Open source jfree.org/jfreechart
Limited

Okta Okta Identity Cloud Technology integrations 30 days okta.com

OmniFaces OmniFaces JSF utility library Open source omnifaces.org

THE DZONE GUIDE TO JAVA PAGE 32 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Computer vision libraries (w/Java


OpenCV Team OpenCV Open source opencv.org
interfaces)

javaee.github.io/glassfish/
Oracle GlassFish 5 Java application server Open source
download

docs.oracle.com/javase/8/
Oracle JavaFX Java GUI library Open source javase-clienttechnologies.
htm
download.oracle.com/
Oracle JAX-RS REST spec for Java Open source otndocs/jcp/jaxrs-2_0-fr-
eval-spec
oracle.com/technetwork/
Oracle JDeveloper IDE Open source developer-tools/jdev/
overview

RESTful web services in Java (JAX-


Oracle Jersey Open source github.com/jersey/jersey
RS w/enhancements)

oracle.com/technetwork/
Java spec for server-side
Oracle JavaServer Faces Open source java/javaee/
component-based UI
javaserverfaces-139869.html

Server-side Java web templating oracle.com/technetwork/


Oracle JSP Open source
(static & dynamic)  java/javaee/jsp

Oracle NetBeans IDE Open source netbeans.org

oracle.com/technetwork/
Oracle Oracle Coherence In-memory ditributed data grid Open source middleware/coherence/
overview

oracle.com/database/
Oracle Oracle Database 19c Relational DBMS N/A
technologies

Oracle VisualVM JVM monitoring Open source visualvm.github.io

oracle.com/middleware/
Oracle WebLogic Java application server N/A
weblogic

Dynamic component system spec


OSGi Alliance OSGi Open source osgi.org
for Java

Demo
Rapid application development
OutSystems OutSystems available by outsystems.com
platform
request

JVM agent for production Available by


OverOps OverOps overops.com
debugging request

Java bytecode manipulation &


OW2 Consortium ASM Open source asm.ow2.io
analysis framework

Java EE application server


Payara Payara Server Open source payara.fish/home
(enchanced GlassFish)

THE DZONE GUIDE TO JAVA PAGE 33 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

github.com/pedestal/
Pedestal Pedestal Clojure web framework Open source
pedestal

High-performance drop-in MySQL percona.com/software/


Percona Percona Server Open source
or MongoDB replacement mysql-tools

Distributed in-memory data grid pivotal.io/big-data/pivotal-


Pivotal GemFire Open source
(using Apache Geode) gemfire

Non-blocking, async JVM library


Pivotal & Spring Project Reactor Open source projectreactor.io
(based on Reactive Streams spec)

REST web services framework spring.io/projects/spring-


Pivotal Spring Boot Open source
(opinionated, rapid spinup) boot

Distributed systems framework spring.io/projects/spring-


Pivotal Spring Cloud Open source
(declarative, opinionated) cloud

Enterpise Java platform (large family


of convention-over-configuration
spring.io/projects/spring-
Pivotal Spring Framework services, e.g. dependency injection, Open source
framework
MVC, messaging, testing, AOP, data
access, distributed computing services)

docs.spring.io/spring/docs/
Pivotal Spring MVC Server-side web framework Open source current/spring-framework-
reference/web.html

Memory leak detection, GC


Plumbr Plumbr 14 days plumbr.io
analysis, thread & query monitoring

PrimeTek PrimeFaces UI components for JSF Open source primefaces.org

JDBC connectors (many data Available by


Progress Software DataDirect progress.com/jdbc
sources) request

PTC ThingWorx IoT platform w/Java SDK 30-90 days developer.thingworx.com

Free tier
PubNub PubNub Real-time mobile, web, & IoT APIs pubnub.com
available
Open-source
Infrastructure automation/
Puppet Labs Puppet versions puppet.com
configuration mgmt
available
Free tier
Push Technology Diffusion Real-time messaging (web, mobile, IoT) pushtechnology.com
available

Free tier
Qoppa Software Qoppa PDF Studio PDF manipulation from Java qoppa.com
available

QOS.ch Logback Java logging framework Open source logback.qos.ch

QOS.ch Sl4j Logging for Java Open source slf4j.org

Raphael
CGLIB Byte code generation library Open source github.com/cglib/cglib
Winterhalter

THE DZONE GUIDE TO JAVA PAGE 34 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Deployment automation &


Red Hat Ansible Open source ansible.com
configuration mgmt

SaaS IDE w/dev workspace Free tiers


Red Hat Codenvy IDE codenvy.com
isolation available

Red Hat Drools Business rules mgmt system Open source drools.org

Red Hat Hibernate ORM Java ORM w/JPA & native APIs Open source hibernate.org/orm

Full-text search for objects (indexes


Red Hat Hibernate Search domain model w/annotations, returns Open source hibernate.org/search
objects from free text queries)

Distributed in-memory key/value


Red Hat Infinispan Open source infinispan.org
store (Java-embeddable)

In-memory distributed NoSQL data Available by redhat.com/en/technologies/


Red Hat JBoss Data Grid
store request jboss-middleware/data-grid

developers.redhat.com/
Red Hat JBoss EAP Java EE 7 platform Open source
products/eap/overview

Red Hat JGroups Java multicast messaging library Open source jgroups.org

Red Hat RichFaces UI components for JSF Open source richfaces.jboss.org

Packaging & running Java EE


Red Hat Thorntail Open source thorntail.io
aplications

Red Hat WildFly Java application server Open source wildfly.org

In-memory key-value data


Redis Labs Redis structure store (use as DB, cache, Open source redis.io
message broker)

Ring Ring Clojure web framework Open source github.com/ring-clojure/ring

Available by
Riverbed SteelCentral APM riverbed.com
request

Free tier
Salesforce Heroku Platform PaaS heroku.com
available

Free developer
Salesforce Salesforce App Cloud PaaS w/app marketplace developer.salesforce.com
version

Sauce Labs Browser & mobile test automation


Sauce Labs Automated Testing (Selenium, Appium) w/Java 14 days saucelabs.com/open-source
Platform interface

Scalatra Team Scalatra Scala web microframework Open source scalatra.org

THE DZONE GUIDE TO JAVA PAGE 35 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Browser automation w/Junit &


Slenium Selenium Open source seleniumhq.org
TestNG integration

Software AG EHCache JCache implementation Open source ehcache.org

Terracotta In-memory data grid w/Ehcache Available by terracotta.org/bigmemory-


Software AG
BigMemory Max (JCache implementation) request and-web-sessions

Software quality platform (unit testing,


SonarSource SonarQube code metrics, architecture & complexity Open source sonarqube.org
analysis, coding rule checks)

Available by sonatype.com/nexus-
Sonatype Nexus Repository Binary/artifact repository
request repository-sonatype

Lightweight Java 8 web app


Spark Spark Framework Open source sparkjava.com
framework

Test & specification framework for


Spock Spock Open source spockframework.org
Java & Groovy

Dependency injector for Android


Square Dagger Open source github.com/google/dagger
& Java

Security & open-source scanning &


Synopsys Black Duck Platform Open source blackducksoftware.com
mgmt (w/container support)

Data warehousing, analytics, lake,


Open-source
SQL on Hadoop & Cassandra, big
Teradata Teradata version teradata.com
data appliances, R integration,
available
workload mgmt

Java unit testing framework (JUnit-


TestNG TestNG Open source testng.org/doc
inspired)

Thinking Software,
Race Catcher Dynamic race detection N/A thinkingsoftware.com
Inc.

ThoughtWorks Go Continuous delivery server Open source go.cd

Server-side Java web template


Thymeleaf Thymeleaf Open source thymeleaf.org
engine

Runtime application self-protection Free tier


Trend Micro Immunio immun.io
w/Java support available

Available by
Twilio Twilio Messaging APIs (text, voice, VoIP) twilio.com
request

RPC for high-concurrency JVM


Twitter Finagle servers (Java & Scala APIs, uses Open source twitter.github.io/finagle
Futures)

Scala HTTP services built on


Twitter Finatra Open source twitter.github.io/finatra
TwitterServer & Finagle

THE DZONE GUIDE TO JAVA PAGE 36 OF 38


DZONE.COM/GUIDES

Company Product Product Type Open Source? Website

Open-source
Vaadin Vaadin Server-side Java -> HTML5 version vaadin.com
available

Event-driven, non-blocking JVM


Vert.x Vert.x Open source vertx.io
framework

Open-source
vmlens vmlens Java race condition catcher version vmlens.com
available
Demo
Java security (runtime application
Waratek Waratek available by waratek.com
self-protection)
request
Open-source
Whitesource Whitesource OSS component security version whitesourcesoftware.com
available

Wiremock Wiremock HTTP mocking Open source wiremock.org

Scala web framework w/ORM,


WorldWide
Lift strong view isolation, emphasis on Open source liftweb.net
Conferencing
security

WSO2 Application wso2.com/products/


WSO2 Web application server Open source
Server application-server

wso2.com/products/
WSO2 Microservices
WSO2 Microservices framework for Java Open source microservices-framework-
Framework for Java
for-java

Deployment automation & release


XebiaLabs XebiaLabs XL 30 days xebialabs.com
mgmt

Xstream Xstream XML serialization Open source x-stream.github.io

REST web services framework


Yammer Dropwizard Open source dropwizard.io/1.3.1/docs
(opinionated, rapid spinup)

Free developer
YourKit YourKit Java Profiler Java CPU & memory profiler yourkit.com
version

Automated detection of code


Yonita Yonita N/A yonita.com
defects

Available by zeroturnaround.com/
ZeroTurnaround JRebel Class hot-loading (in running JVM)
request software/jrebel

zeroturnaround.com/
ZeroTurnaround XRebel Java web app profiler 10 days
software/xrebel

Zkoss ZK Framework Enterprise Java web framework Open source zkoss.org

Zoho Site24x7 Website, server, APM 30 days site24x7.com

THE DZONE GUIDE TO JAVA PAGE 37 OF 38


DZONE.COM/GUIDES

INTRODUCING THE

Java Zone
Java remains the most popular programming language even as it continuously
evolves. From updated APIs to new JDK 11 and JDK 12 features, there’s plenty to
unpack in the current Java ecosystem.

Keep a pulse on the industry with topics such as:

• New Java APIs • Spring framework


• Epsilon and garbage collection • Other JVM language
• Java EE and Jakarta EE

Visit the Zone

TUTORIALS CASE STUDIES BEST PRACTICES CODE SNIPPETS

THE DZONE GUIDE TO JAVA PAGE 38 OF 38

You might also like