So you want to migrate to Java 11 but your Maven project is still sitting on Java 8? You don’t care much about the new module system (Jigsaw) introduced in Java 9, you just want your application to run on the latest JDK version? Then this guide is for you. It includes everything I’ve learned while migrating our product to Java 11.| winterbe
Kotlin is a fascinating programming language that combines both object-oriented and functional programming concepts. Sequences are a key abstraction to functional programming in Kotlin, a concept quite similar to Java 8 Streams. Sequences enable you to easily operate upon collections of elements by chaining pure function calls with a rich fluent API. Let’s take a deeper look at how sequences work and what you can achieve with it in this example-driven tutorial.| winterbe
One of the great parts of React.js is the ease of integration into existing web projects. Many full-fledged JavaScript MVC frameworks like Angular.js impose the architecture of your application code, thus making an integration into existing projects hard to impossible without rewriting entire parts of the frontend code.| winterbe
Welcome to the third part of my tutorial series about multi-threaded programming in Java 8. This tutorial covers two important parts of the Concurrency API: Atomic Variables and Concurrent Maps. Both have been greatly improved with the introduction of lambda expressions and functional programming in the latest Java 8 release. All those new features are described with a bunch of easily understood code samples. Enjoy!| winterbe
Welcome to the second part of my Java 8 Concurrency Tutorial out of a series of guides teaching multi-threaded programming in Java 8 with easily understood code examples. In the next 15 min you learn how to synchronize access to mutable shared variables via the synchronized keyword, locks and semaphores.| winterbe
Welcome to the first part of my Java 8 Concurrency tutorial. This guide teaches you concurrent programming in Java 8 with easily understood code examples. It’s the first part out of a series of tutorials covering the Java Concurrency API. In the next 15 min you learn how to execute code in parallel via threads, tasks and executor services.| winterbe
Plenty of tutorials and articles cover the most important changes in Java 8 like lambda expressions and functional streams. But furthermore many existing classes have been enhanced in the JDK 8 API with useful features and methods.| winterbe
How to prevent the famous NullPointerException in Java? This is one of the key questions every Java beginner will ask sooner or later. But also intermediate and expert programmers get around this error every now and then. It’s by far the most prevalent kind of error in Java and many other programming languages as well.| winterbe
How to learn programming? This is probably the key question everyone asks himself at the beginning of his programming career. No matter what language you start with - programming has so many aspects and facets, it’s extremely hard to figure out how to start.| winterbe
Java 8 has been released almost one year ago in March 2014. At Pondus we’ve managed to update all of our production servers to this new version back in May 2014. Since then we’ve migrated major parts of our code base to lambda expressions, streams and the new Date API. We also use Nashorn to dynamically script parts of our application which may change during runtime.| winterbe
This article demonstrates how to combine React.js with Java and Spring Boot in order to pre-render fully-fledged MVC-frontends on the JVM server without even thinking about Node.js.| winterbe
Just in time before christmas I’ve finished my recent site project: The GitHub Matrix| winterbe
Mac OSX is your preferred operation system as a developer? Then chances are good that you already use iCloud. Apple introduced iCloud Drive with OSX 10.10 (Yosemite) which grants you direct access to your remote iCloud folder. Finally you can move files directly between your local harddrive and iCloud back and forth.| winterbe
When I started to learn Java in 2001, I’ve spent hours and hours reading and crawling the Javadoc API back and forth. It’s a great source of knowledge and Sun (now Oracle) did a great job in documenting all the core concepts of the Java API.| winterbe
This example-driven tutorial gives an in-depth overview about Java 8 streams. When I first read about the Stream API, I was confused about the name since it sounds similar to InputStream and OutputStream from Java I/O. But Java 8 streams are a completely different thing. Streams are Monads, thus playing a big part in bringing functional programming to Java:| winterbe
Nake is a simplified version of Make (Cake, Jake, Rake) for Java 8 based on the Nashorn Javascript Engine. I wrote Nake to automate common tasks in our daily project business here at Pondus. You define tasks in a project-specific Nakefile and call those tasks from the command line. Tasks are written in Javascript empowered by the JDK 8 API and your preferred external java libraries. You don’t have to mess with native shell scripts any more.| winterbe
This example demonstrates how to use Backbone.js models with the Java 8 Nashorn Javascript Engine. First released in March 2014 as part of Java SE 8, Nashorn extends Javas capabilities by running javascript code natively on the JVM. For java web developers Nashorn might be especially useful for re-using existing client-side code on the java server. Traditionally Node.js was in a clear advantage, but Nashorns possibilities might close the gap to the JVM.| winterbe
Learn all about the Nashorn Javascript Engine with easily understood code examples. The Nashorn Javascript Engine is part of Java SE 8 and competes with other standalone engines like Google V8 (the engine that powers Google Chrome and Node.js). Nashorn extends Javas capabilities by running dynamic javascript code natively on the JVM.| winterbe
The Mars Rover was sent to space to discover the surface of the mars. Now YOU are sent out to the JDK 1.8 API to discover all the new classes and hidden gems. But before starting your journey make sure you’re familiar with the most recent changes in Java 8 by reading my Java 8 Tutorial and my Java 8 Nashorn Javascript Tutorial.| winterbe
“Java is still not dead—and people are starting to figure that out.”| winterbe
Finally, a fix for crappy looking icon-fonts in Firefox for Mac OSX is on it’s way:| winterbe
Hibernate @BatchSize annotation is a great way to increase performance when dealing with large result sets:| winterbe
What’s your first action after opening an unknown class file with the Eclipse IDE? I for myself first inspect the Outline view to get a general idea about the involved members and methods. It’s totally crucial to me to optimize the contents of the Outline view, thus minimizing the time to getting started with unknown sourcecode. Let’s take a look how to improve the Outline view.| winterbe
Hibernate enables you to improve the performance of your application by using second-level caching. What does this mean? The second-level cache is capable of caching hibernate entities even when the hibernate session closes.| winterbe
The Eclipse IDE not only is one of the most popular IDEs. It’s also a very complex tool with countless features and commands. Knowing most of these features is crucial for developers. The following articles contains five tips for customizing and tweaking the Eclipse IDE.| winterbe
Did you ever felt that working with the Java Collections Framework could be more elegant or efficient? Then you really should consider to use the Google Collections API. It’s a great utility library every Java developer should know. Take the time to read this introduction to easily getting started with Google Collections.| winterbe
This article introduces an approach to preload certain relations in complex object graphs with Hibernate on a per-usecase basis. The intention is to prevent LazyInitializationException during runtime and to reduce the N+1 SELECT problem while working with lazy relations. What does per-usecase mean in this context? The approach affords to easily decide which parts of an object graph are directly loaded by Hibernate for each and every usecase . If you’re familiar with these problems you can s...| winterbe
As one of the most popular IDEs for developing Java applications, Eclipse can be adjusted with plenty of preferences. Here are my five favorite adjustments to tweak the Eclipse IDE. It works well with either the newest Eclipse Galileo or one of the older releases like Ganymede or Europa.| winterbe
Using mock-objects is crucial when it comes to unit-testing enterprise applications. Mocks prevent you from implicitly testing parts of your application many times. This not only leads to faster running times of the testsuites. It also improves time to find the cause of a bug on failure.| winterbe
Did you ever have to bother with LazyInitializationExceptions in Hibernate? I’m sure you have. :) This famous exception occurs if you try to access any non-initialized assocation (or proxy) when the assigned hibernate session has already been closed.| winterbe
Even though Hibernate is called an object-relational mapper it’s easy to select only a few properties instead of the whole mapped object. The hibernate query language (HQL) is very expressive. If you select some properties instead of the whole object, the call of Query#list() returns a list of object arrays. Each field of the array contains one of the selected properties.| winterbe
Do you know the intersection between the Google Collections API and TestNG? Both APIs contain a class Lists with two identical methods newArrayList(). No problem so far, but you should really pay attention which one to import. If you set up your project with Maven2 it’s best practice to use the test scope on each test-specific dependency. That means wrongly importing org.testng.v6.Lists in productive code would leed to some weird compiler errors on running the build scripts. So pay attentio...| winterbe
The principle of Separation of Concerns is one of the main aspects of modern application frameworks like Spring or Hibernate. The intention is to separate the cross-cutting-concerns (e.g. database access, transaction management or security checks) from the implementation of the functional requirements.| winterbe
Here are some of my most used keyboard shortcuts for the Eclipse IDE.| winterbe
The EventBus library is a convenient realization of the observer pattern. It works perfectly to supplement the implementation of MVC logic (model-view-controller) in event-driven UIs such as Swing. The library is similiar to the JMS API and it’s published under the Apache License 2.0.| winterbe
The class javax.swing.TransferHandler is a convenient solution for implementing drag-and-drop in a Java Swing UI. You don’t have to bother about the internal concepts of drag-and-drop in Swing.| winterbe
There is a problem with some distributions of Eclipse Ganymede relating the PDE target platform. If you want to set up the target platform (see Preferences -> Plug-In Development) you cannot add Plugins to the list via the Add… command. There is no error dialog, the list of plugins just stays empty.| winterbe
An example of how to write custom code templates in Eclipse| winterbe.com
Hello. I'm a Principal Software Engineer and Full Stack Developer. I tweet and blog about Kotlin, Java, TypeScript, JavaScript, React and PostgreSQL.| winterbe.com
Learn what's new in Java 9 to 11: Local Variable Type Inference, HTTP-Client, Collections, Streams, Optionals, Strings, InputStreams and more.| winterbe.com