Posts

Showing posts with the label java17

Changing the Default Terminal to Terminator on Ubuntu

Image
Terminator is a powerful tool for developers, allowing you to manage multiple terminal sessions in a single window. Features like splitting panes, tabs, and simultaneous input can significantly boost your productivity. Step 1: Install Terminator First, install Terminator using the apt package manager. sudo apt update sudo apt install terminator -y The -y option automatically answers 'yes' to any prompts during the installation process, streamlining the setup. Step 2: Set as the System Default Ubuntu uses a utility called update-alternatives to manage default applications. We'll use this tool to change the default terminal emulator ( x-terminal-emulator ) to Terminator. Run the Configuration Command Enter the following command in your terminal. A list of available terminals will appear. sudo update-alternatives --config x-terminal-emulator Select Terminator From the resulting list, enter the selection number corresponding to terminator and press Enter. ...

Accessing Configuration Values in Spring Boot with @Value Annotation

Spring Boot simplifies the process of accessing external configuration properties, like those defined in application.properties or application.yml, making it easier to maintain and change these properties without altering the codebase. A common approach to access these values is by using the @Value annotation in Spring-managed beans. However, sometimes developers encounter issues when trying to inject these values directly into their classes. The Problem Consider you have the following setup in your Spring Boot application: application.yml app: default-avatar-url: /images/twitter-default-avatar.jpg AuthServiceImpl.java import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @Service public class AuthServiceImpl implements AuthService { @Value("${app.default-avatar-url}") private String defaultAvatarUrl; } However, when you run the application, you encounter a startup failure with the following error me...