Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Microservices with Micronaut®

You're reading from   Building Microservices with Micronaut® A quick-start guide to building high-performance reactive microservices for Java developers

Arrow left icon
Product type Paperback
Published in Sep 2021
Publisher Packt
ISBN-13 9781800564237
Length 362 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Zack Dawood Zack Dawood
Author Profile Icon Zack Dawood
Zack Dawood
Nirmal Singh Nirmal Singh
Author Profile Icon Nirmal Singh
Nirmal Singh
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Core Concepts and Basics
2. Chapter 1: Getting Started with Microservices Using the Micronaut Framework FREE CHAPTER 3. Section 2: Microservices Development
4. Chapter 2: Working on Data Access 5. Chapter 3: Working on RESTful Web Services 6. Chapter 4: Securing the Microservices 7. Chapter 5: Integrating Microservices Using Event-Driven Architecture 8. Section 3: Microservices Testing
9. Chapter 6: Testing Microservices 10. Section 4: Microservices Deployment
11. Chapter 7: Handling Microservice Concerns 12. Chapter 8: Deploying Microservices 13. Section 5: Microservices Maintenance
14. Chapter 9: Distributed Logging, Tracing, and Monitoring 15. Section 6: IoT with Micronaut and Closure
16. Chapter 10: IoT with Micronaut 17. Chapter 11: Building Enterprise-Grade Microservices 18. Assessment 19. Other Books You May Enjoy

Getting started with the Micronaut framework

In order to get started with the Micronaut framework, we will begin by installing the Micronaut CLI on Mac and Windows OS.

Installing the Micronaut CLI on mac OS

On mac OS, we can install the Micronaut CLI in a couple of ways – using SDKMAN!, Homebrew, or MacPorts. In the following sections, we will cover step-by-step instructions to install the Micronaut CLI.

Installing Micronaut using SDKMAN!

Please follow these steps to install the Micronaut CLI using SDKMAN!:

  1. Open Terminal.
  2. If you don't have SDKMAN! installed, take the following steps:

    a. Type or paste the following command:

    curl -s https://get.sdkman.io | bash

    b. Next, type or paste the following command:

    source "$HOME/.sdkman/bin/sdkman-init.sh"
  3. To install the Micronaut CLI, type or paste the following command:
    source sdk install micronaut

    You will observe the following interactions on Terminal while installing the Micronaut CLI:

    Figure 1.5 – Installing Micronaut CLI on mac OS using SDKMAN!

    Figure 1.5 – Installing Micronaut CLI on mac OS using SDKMAN!

  4. If all the preceding steps execute successfully, you can verify the Micronaut CLI installation by running the following command in Terminal:
    mn -version

Installing Micronaut using Homebrew

Please follow these steps to install the Micronaut CLI using MacPorts:

  1. Open Terminal.
  2. If you don't have Homebrew installed, then take the following steps:

    a. Type or paste the following command:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

    b. Next, type or paste the following command:

    brew update 
  3. Type or paste the following command:
     brew install micronaut

    You will observe the following interactions on Terminal while installing the Micronaut CLI:

    Figure 1.6 – Installing the Micronaut CLI on mac OS using HomeBrew

    Figure 1.6 – Installing the Micronaut CLI on mac OS using HomeBrew

  4. If all the preceding steps execute successfully, you can verify the Micronaut CLI installation by hitting the following command in Terminal:
    mn -version

Installing Micronaut using MacPorts

Please follow these steps to install the Micronaut CLI using Homebrew:

  1. If you don't have MacPorts installed, then follow the instructions at https://www.macports.org/install.php.
  2. Open Terminal.
  3. Type or paste the following command:
    sudo port sync
  4. Type or paste the following command:
    sudo port install micronaut

    You will observe the following interactions on Terminal while installing the Micronaut CLI:

    Figure 1.7 – Installing the Micronaut CLI on macOS using MacPorts

    Figure 1.7 – Installing the Micronaut CLI on macOS using MacPorts

  5. If all the preceding steps execute successfully, you can verify the Micronaut CLI installation by hitting the followed command in Terminal:
    mn -version

Installing the Micronaut CLI on Windows

Please follow these steps to install the Micronaut CLI on Windows:

  1. Download the Micronaut CLI binary from the Micronaut download page: https://micronaut.io/download.html.
  2. Unzip the downloaded binary file into a folder on your system. It is better to keep this in a separate folder under a root directory such as C:\Program Files\Micronaut.
  3. Create a new system variable called MICRONAUT_HOME with the preceding directory path. Please note to add this variable under system variables (not user variables).
  4. Then, update your Windows PATH environment variable. You can add a path such as %MICRONAUT_HOME%\bin.
  5. Open Command Prompt or any terminal and type the following command:
    mn

    This will boot up the CLI for the first time by resolving any dependencies.

  6. To test that the CLI is installed properly, type the following command:
    mn – h

    This is what the command outputs:

    Figure 1.8 – Installing the Micronaut CLI on Windows OS

    Figure 1.8 – Installing the Micronaut CLI on Windows OS

  7. You should see all the CLI options after hitting the preceding command.

In this section, we explored different ways to install the Micronaut CLI in Windows and macOS. In order to get hands-on with the Micronaut framework, we will get started with working on a hello world project in the next section.

You have been reading a chapter from
Building Microservices with Micronaut®
Published in: Sep 2021
Publisher: Packt
ISBN-13: 9781800564237
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image