Category Java

Install Spring Boot Application As A Linux Service

This tutorial is going to cover how to install a Spring Boot application as a Linux service, which enables us to start, stop and check application status using standard commands such as: service start payment-service, service stop payment-service and service… Continue Reading →

Apache Tomcat – How To Set Up Environment Variables

1. Overview In this tutorial, we’re going to see to how set up environment variables for applications deployed in Apache Tomcat. 1. Set up Environment Variables For Apache Tomcat On Windows One popular approach to set up environment variables for… Continue Reading →

Java – Lookup Java Enum From String Value

This tutorial is going to cover how to lookup Java enum from string value. 1. Lookup Enum From Value With Simple Enum Type Let’s assume that we have a simple enum as follows: To lookup a Java enum from its… Continue Reading →

JUnit 5 and Mockito Example

In this short tutorial, we’re going to explore how to use JUnit 5 and Mockito, a popular mocking framework for unit tests written in Java. 1. JUnit 5 and Mockito Dependencies 1.1. Maven Dependencies At first, let’s take a look… Continue Reading →

Spring Boot – How To Set Active Profiles

In this tutorial, we’re going to show how to set active profiles for Spring Boot applications. This is useful for us during application development and deployment. 1. Set Active Spring Profiles In The File We can set active profiles… Continue Reading →

Java 9 JShell – Execute And Exit A Script

JShell, which has been introduced since Java 9, is an interactively evaluates declarations, statements, and expressions of the Java programming language in a read-eval-print loop (REPL). This tutorial is going to show how to execute and exit a script with… Continue Reading →

Create An Immutable Set In Java 9 By Static Factory Methods

In this tutorial, we’re going to get through how to create an immutable Set in Java 9 by using convenience static factory methods of the Set interface, which have been added into Java 9. 1. Create An Immutable Set In… Continue Reading →

RxJava 2 – FlatMap Example

In this tutorial, we’re going to get through some examples of the FlatMap operator of both Observable and Flowable types in RxJava 2. 1. Library Dependency To use RxJava 2 with Maven, we need to add the following dependency to… Continue Reading →

Serialize Java 8 LocalDate With Jackson In Spring Boot

This tutorial is going to illustrate how to serialize Java 8 LocaleDate with Jackson in Spring Boot. Besides, we also get through how to serialize other types of Java 8 Date Time API. 1. Overview Java 8 introduced us a… Continue Reading →

Gson – Convert A String To JsonObject

This quick tutorial is going to illustrate how to convert a Json string to JsonObject using Gson, a Java serialization/deserialization library to convert Java Objects into JSON and back. 1. Prerequisites We will need to include Gson library dependency in… Continue Reading →

« Older posts

© 2021 HowToProgram — Powered by WordPress

Theme by Anders NorenUp ↑

NewsletterSubscribe To Learn More