请教如何安装Micronaut CLI?文档中未找到安装指引
Hey there, I totally get how frustrating it is when you’re ready to dive into using a tool but can’t track down the setup steps! Let me walk you through how to install the Micronaut CLI (mn) since the official docs you checked seem to skip over that critical part.
mn) Below are the official, supported installation methods that should work across all major platforms:
Using SDKMAN! (Recommended)
This is the go-to method for most developers, as it handles version management seamlessly:
- Open your terminal and run this command to install the latest stable version:
sdk install micronaut - To confirm the installation was successful, run:
You should see the installed Micronaut version printed out in your terminal.mn --version
Using Homebrew (macOS/Linux)
If you’re on a Mac or using Linux with Homebrew set up, this is a quick option:
- Run the following in your terminal:
brew install micronaut - Verify the installation the same way as above:
mn --version
Manual Installation (All Platforms)
If you prefer not to use a package manager, you can install manually:
- Navigate to the official Micronaut downloads section (accessible from the main site)
- Download the ZIP archive matching your operating system
- Extract the ZIP file to a directory of your choice (e.g.,
~/micronauton macOS/Linux,C:\micronauton Windows) - Add the
binsubdirectory from the extracted folder to your system’sPATHenvironment variable:- Linux/macOS: Edit your shell config file (like
~/.bashrc,~/.zshrc, or~/.profile) and add this line (replace/path/to/micronautwith your actual extraction path):
Then runexport PATH="$PATH:/path/to/micronaut/bin"source ~/.bashrc(or the relevant config file) to apply the change immediately. - Windows: Open System Properties > Advanced > Environment Variables, find the
Pathvariable under System Variables, edit it, and add the full path to thebinfolder (e.g.,C:\micronaut\bin).
- Linux/macOS: Edit your shell config file (like
- Finally, confirm it’s working with
mn --version
Once mn is installed, you can jump right into using all those examples from the docs—like creating a new project with mn create-app com.example.myapp or generating controllers with mn create-controller com.example.MyController.
内容的提问来源于stack exchange,提问作者Eduardo Lago Aguilar

