简体   繁体   English

如何在 Ubuntu 中安装 Spring Boot CLI?

[英]How do I install Spring Boot CLI in Ubuntu?

I am trying to install Spring Boot CLI in Ubuntu.我正在尝试在 Ubuntu 中安装 Spring Boot CLI。 I am new to spring boot and was trying to learn it.我是弹簧靴的新手,正在努力学习它。 I have already installed Gradle and groovy but did not find anything online to install Spring boot CLI.我已经安装了 Gradle 和 groovy,但是没有在网上找到任何可以安装 Spring boot CLI 的东西。

please follow the code请按照代码

sudo apt install unzip zip
curl -s https://get.sdkman.io | bash
source "/home/username/.sdkman/bin/sdkman-init.sh"=
sdk install springboot
spring version

Spring boot CLI 安装指南链接Spring boot CLI

Here is detailed instruction on how to do it, much more useful than official one, at least for manual installation. 是有关如何执行此操作的详细说明,至少对于手动安装而言比官方的有用得多。 One more thing - to make path change permanent you might need to logout - login, as "source /etc/profile" will be effective only for currently opened terminal.还有一件事-要使路径更改永久化,您可能需要注销-登录,因为“source /etc/profile”仅对当前打开的终端有效。

You can read the docs for installation steps:您可以阅读文档以了解安装步骤:

Manual installation:手动安装:

  1. Download the Spring CLI distribution: you can find the latest version link here .下载Spring CLI 发行版:您可以在此处找到最新版本链接。
  2. Extract the downloaded zip file to any path of your choice.将下载的 zip 文件解压缩到您选择的任何路径。
  3. Prerequisite : Make sure you have Java JDK v1.8 or above (check INSTALL.txt file from extracted archive in Step-1).先决条件:确保您拥有 Java JDK v1.8或更高版本(检查步骤 1 中提取的存档中的INSTALL.txt文件)。 You can check your JDK version using command: java --version .您可以使用以下命令检查 JDK 版本: java --version
  4. Add the spring CLI script 's path to $PATH environment variable: For example, you can add below lines to your .bashrc file in * nix systems:spring CLI 脚本的路径添加到$PATH环境变量中:例如,您可以在 * nix系统中的.bashrc文件中添加以下行:
export SPRING_HOME=/path/to/your/extracted-spring-cli/spring-2.4.0
export PATH=$SPRING_HOME/bin:$PATH

After saving the .bashrc file, run $ source .bashrc to reload the environment variables you just added.保存.bashrc文件后,运行$ source .bashrc重新加载刚刚添加的环境变量。

  1. (optional; and not for Windows user) Shell auto-completion scripts are provided for BASH and ZSH with the extracted archive in Step-1. (可选;不适用于 Windows 用户)为 BASH 和 ZSH 提供了Shell 自动完成脚本,并在步骤 1 中提取了存档。 Add symlinks to the appropriate location for your environment.符号链接添加到适合您环境的位置。 For example, something like:例如,类似:
  ln -s /path/to/your/extracted-spring-cli/spring-2.4.0/shell-completion/bash/spring /etc/bash_completion.d/spring
  ln -s /path/to/your/extracted-spring-cli/spring-2.4.0/shell-completion/zsh/_spring /usr/local/share/zsh/site-functions/_spring

To check if you are using BASH or ZSH, run the command: $ echo $SHELL .要检查您使用的是 BASH 还是 ZSH,请运行以下命令: $ echo $SHELL

  1. DONE : To test if you have successfully installed the CLI you can run the following command: spring --version . DONE :要测试您是否已成功安装 CLI,您可以运行以下命令: spring --version

Use this link to get a detailed instruction on how to download the Spring framework successfully, It really helped me a lot after long time of making research.使用此链接可以获取有关如何成功下载 Spring 框架的详细说明,经过长时间的研究,它确实对我帮助很大。

https://www.decodejava.com/download-and-install-spring-framework.htm https://www.decodejava.com/download-and-install-spring-framework.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM