6.5 million software developers and still going strong

Java Developer Magazine

Subscribe to Java Developer Magazine: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Java Developer Magazine: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories

A Practical Guide to Java Remote Debugging By Eugen Paraschiv Introduction to Debugging Troubleshooting a problem on a remote server, especially in production, is not an easy task. Sometimes it involves debugging the application code directly on the server. But the production servers are usually run in a strict environment, where not all convenient developer tools are available. In this article, you'll discover how to configure a running web server and debug your application using standard facilities provided by the Java platform. Caveats First off, if you try to connect to a remote running Java server which you did not specifically configure for debugging, you'd most likely fail. This means that the configuration steps should be taken in advance. On the other hand, you wouldn't want to always keep the production server running with debugging configuration enabled, a... (more)

Java 9 Language Features | @CloudExpo #Java #APM #Monitoring

Java 9 Language Features By Philipp Lengauer Java 9 ships with some minor—yet awesome—new language features that make developing easier and cleaner. In this post, we’ll take a look at three of these new features. Private interface methods You probably remember interface methods, which were introduced in Java 8. These are required so that Java itself, as well as framework vendors, can add new methods to interfaces without breaking pre-existing implementations. As these methods can become rather complex, Java now enables you to declare interface methods as private. This allows for extracting common code from interface methods while hiding the code from external use. public interface DeepThought { abstract int foo(); abstract int bar(); default int fooDecorated() { return decorate(foo()); } default int barDecorated() { return decorate(bar()); } private int decorate(int valu... (more)

Java Virtual Machine | @CloudExpo @Stackify #DX #JVM #Java #Virtualization

A Deep Dive into the Core Metrics of the Java Virtual Machine By Eugen Paraschiv Overview of JVM Metrics In this article, we'll cover how you can monitor an application that runs on the Java Virtual Machine by going over some of the critical metrics you need to track. And, as a monitoring tool, we'll use Stackify Retrace, a full APM solution. The application we'll monitor to exemplify these metrics is a real-world Java web application built using the Spring framework. Users can register, login, connect their Reddit account and schedule their posts to Reddit. How JVM Memory Works There are two important types of JVM memory to watch: heap and non-heap memory, each of these with its own purpose. The heap memory is where the JVM stores runtime data represented by allocated instances. This is where memory for new objects comes from, and is released when the Garbage Colle... (more)

Java Web Services Tutorial | @CloudExpo #DevOps #API #Java #Microservices

Java Web Services Tutorial: Improve App Communication and Flexibility By Eugen Paraschiv Web services have taken the development world by storm, especially in recent years as they've become more and more widely adopted. There are naturally many reasons for this, but first, let's understand what exactly a web service is. The World Wide Web Consortium (W3C) defines "web of services" as "message-based design frequently found on the Web and in enterprise software". Basically, a web service is a method of sending a message between two devices through a network. In practical terms, this translates to an application which outputs communication in a standardized format for other client applications to receive and act on. Web services have been adopted so quickly because they bring several important advantages: Allow communication and interoperability between applications r... (more)

What Is Java #DevOps? | @DevOpsSummit #CloudNative #Serverless #AI #DX

What is Java DevOps? Benefits, Considerations, Tutorials and More By Angela Stringfellow DevOps sees the coming together of practices, philosophies, and tools that allow you to create services and applications very quickly. This means that you can improve on your apps and evolve them at a much faster rate than those developers who are using traditional software development processes. We’ve talked about DevOps, in general, a great deal, but today, we’re going to dig a little deeper and take a look at Java DevOps specifically. What Is DevOps? DevOps is simply a portmanteau of software DEVelopment and IT OPerations. It was first called agile operations and involves different disciplines in building, operating and evolving applications and services. Using a DevOps model, you are bringing together your development team and your operations team, and their work is no longer i... (more)

Customer Service: Costs of not doing it well

Image via Wikipedia It is estimated that poor customer service has cost the Cable/Satellite Industry over $12 billion in lost revenues over the past year, ahead of the financial services industry with more than $10 billion in losses; which is startling considering Cable/Satellite companies project themselves as the future of home and business subscription services of all things information and entertainment. How can these companies survive with such a poor record of customer care?  Take the up and coming consumers, ages 27 – 43, who terminated services most frequently at 1 ½ times per year compared to older consumers. These consumers are the target audience that Cable/Telecom companies want the most due to their powerful (Triple Play) buying power. These companies will be looking toward a future where smart and educated consumers, the ones most sought after, will b... (more)

Solving the XML Problem with Jackson | @CloudExpo #API #Java #JSON #Cloud

Solving the XML Problem with Jackson By Eugen Paraschiv Jackson is a popular library for handling JSON in Java applications, quickly becoming the de-facto standard in the ecosystem. Starting with version 2, it has also introduced a mature XML implementation alongside its established JSON support. Adding Jackson XML to the Project Adding the Jackson XML module to the project only needs a single dependency - the Jackson XML module itself: com.fasterxml.jackson.dataformat jackson-dataformat-xml 2.9.0 And in Gradle: compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0" This will automatically pull in all of the other Jackson dependencies that are needed: Jackson Core Jackson Annotations Jackson Databind Jackson Module JAXB Annotations Woodstox StAX Implementation Not... (more)

How Memory Leaks Happen in a Java Application | @CloudExpo #JVM #Java #Virtualization

How Memory Leaks Happen in a Java Application By Eugen Paraschiv Introduction to Memory Leaks In Java Apps One of the core benefits of Java is the JVM, which is an out-of-the-box memory management. Essentially, we can create objects and the Java Garbage Collector will take care of allocating and freeing up memory for us. Nevertheless, memory leaks can still occur in Java applications. In this article, we're going to describe the most common memory leaks, understand their causes, and look at a few techniques to detect/avoid them. We're also going to use the Java YourKit profiler throughout the article, to analyze the state of our memory at runtime. 1. What is a Memory Leak in Java? The standard definition of a memory leak is a scenario that occurs when objects are no longer being used by the application, but the Garbage Collector is unable to remove them from working mem... (more)

Finally Getting the Most out of the Java Thread Pool | @CloudExpo #JVM #Java #Cloud

Finally Getting the Most out of the Java Thread Pool By Eugen Paraschiv First, let's outline a frame of reference for multithreading and why we may need to use a thread pool. A thread is an execution context that can run a set of instructions within a process - aka a running program. Multithreaded programming refers to using threads to execute multiple tasks concurrently. Of course, this paradigm is well supported on the JVM. Although this brings several advantages, primarily regarding the performance of a program, multithreaded programming can also have disadvantages - such as increased complexity of the code, concurrency issues, unexpected results and adding the overhead of thread creation. In this article, we're going to take a closer look at how the latter issue can be mitigated by using thread pools in Java. Why Use a Thread Pool? Creating and starting a thread ... (more)

Java Heap Space vs. Stack Memory | @CloudExpo #JVM #JRE #Java #AI #DX

Java Heap Space vs. Stack Memory: How Java Applications Allocate Memory By Angela Stringfellow Java applications need a certain amount of RAM on a computer to run. Each time an object or variable is declared, it needs more RAM. Simply designating enough memory to hold every value declared and run each method would lead to a bloated application. To keep application memory requirements lean, it is partitioned in ways that require less memory and allows the application to run more quickly. The Java Virtual Machine (JVM) divides memory between Java Heap Space and Java Stack Memory in a way that only uses memory that's needed. What Is Java Heap Space It is created by the Java Virtual Machine when it starts. The memory is used as long as the application is running. Java runtime uses it to allocate memory to objects and Java Runtime Environment (JRE) classes. When an object i... (more)

Mistakes to Avoid When Handling Java Exceptions | @CloudExpo #Java #Cloud #Analytics

Seven Common Mistakes You Should Avoid When Handling Java Exceptions By Thorben Janssen Handling an exception is one of the most common but not necessarily one of the easiest tasks. It is still one of the frequently discussed topics in experienced teams, and there are several best practices and common mistakes you should be aware of. Here are a few things you should avoid when handling exceptions in your application. Mistake 1: Specify a java.lang.Exception or java.lang.Throwable As I explained in one of my previous posts, you either need to specify or handle a checked exception. But checked exceptions are not the only ones you can specify. You can use any subclass of java.lang.Throwable in a throws clause. So, instead of specifying the two different exceptions that are thrown by the following code snippet, you could just use the java.lang.Exception in the throws cla... (more)