繁体   English   中英

在Windows 7中安装spring boot CLI

[英]install spring boot CLI in windows 7

我想在我的Windows 7机器上设置一个开发环境,这样我就可以创建一个spring-boot应用程序。 但是,我很难在Windows上安装Spring-boot。

这就是我到目前为止所做的:-Downloaded spring-boot CLI zip包并在C盘中解压缩-JAVA_HOME变量设置为c:\\ Program Files(x86)\\ Java \\ jdk1.6.0_14 -SPRING_HOME变量设置为C:\\ spring-1.3.0.BUILD-SNAPSHOT - 为PATH环境变量添加了SPRING_HOME / bin

它说要添加符号链接到自动完成脚本,但我不知道如何做到这一点。 毫不奇怪,当我用“spring --version”命令测试安装时,它失败了。

以前有人这样做过吗?

谢谢!

设置说明对于路径设置有点误导。

对于Windows,环境变量部分,需要使用%SPRING_HOME%\\bin 引用代替SPRING_HOME/bin ,以便系统获取SPRING_HOME环境变量。

其中SPRING_HOME是用于指定spring启动目录路径的环境变量。 例如: - C:\\Program Files\\Spring\\spring-1.2.7.RELEASE

注意: bin文件夹不包含在SPRING_HOME

我能够搞定,这里是屏幕抓取的过程。 在此输入图像描述

或者,您可以直接设置路径而不使用SPRING_HOME,只需将环境变量path附加到“spring.bat”文件的目录路径C:\\Program Files\\Spring\\spring-1.2.7.RELEASE\\bin;

在搜索路径之前,Windows会查看当前目录。 因此,当您在bin目录中时,它会在那里看到spring命令,而不会查看路径。

1.MANUALLY INSTALLING THE SPRING BOOT CLI
spring-boot-cli-2.0.0.M1-bin.zip is installed.
2.Extract spring-boot-cli-2.0.0.M1-bin.zip.
3.After  spring-2.0.0.M1 extractd.
4. Direct command prompt
--------------------------
C:\Users\nepl>spring --version
'spring' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\nepl>E:

E:\>cd Nagarjuna

E:\Nagarjuna>cd "spring applications"

E:\Nagarjuna\spring applications>cd spring-2.0.0.M1

E:\Nagarjuna\spring applications\spring-2.0.0.M1>cd bin

E:\Nagarjuna\spring applications\spring-2.0.0.M1\bin>spring -- version
'--' is not a valid command. See 'help'.

E:\Nagarjuna\spring applications\spring-2.0.0.M1\bin>spring --version
Spring CLI v2.0.0.M1
E:\Nagarjuna\spring applications\spring-2.0.0.M1\bin>spring --help

E:\Nagarjuna\spring applications\spring-2.0.0.M1\bin>spring run HelloWorld.groov
y
Resolving dependencies......................................................

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::             (v2.0.0.M1)

2017-12-15 15:36:07.949  INFO 3464 --- [       runner-0] o.s.boot.SpringApplicat
ion               : Starting application on nw0188 with PID 3464 (started by nep
l in E:\Nagarjuna\spring applications\spring-2.0.0.M1\bin)
2017-12-15 15:36:07.996  INFO 3464 --- [       runner-0] o.s.boot.SpringApplicat
ion               : No active profile set, falling back to default profiles: def
ault
2017-12-15 15:36:08.689  INFO 3464 --- [       runner-0] ConfigServletWebServerA
pplicationContext : Refreshing org.springframework.boot.web.servlet.context.Anno
tationConfigServletWebServerApplicationContext@48cd5e87: startup date [Fri Dec 1
5 15:36:08 IST 2017]; root of context hierarchy
2017-12-15 15:36:11.575  INFO 3464 --- [       runner-0] o.s.b.w.embedded.tomcat
.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2017-12-15 15:36:11.606  INFO 3464 --- [       runner-0] o.apache.catalina.core.
StandardService   : Starting service [Tomcat]
2017-12-15 15:36:11.606  INFO 3464 --- [       runner-0] org.apache.catalina.cor
e.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.15
2017-12-15 15:36:12.285  INFO 3464 --- [ost-startStop-1] org.apache.catalina.loa
der.WebappLoader  : Unknown loader org.springframework.boot.cli.compiler.Extende
dGroovyClassLoader$DefaultScopeParentClassLoader@526a6c66 class org.springframew
ork.boot.cli.compiler.ExtendedGroovyClassLoader$DefaultScopeParentClassLoader
2017-12-15 15:36:12.378  INFO 3464 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[loc
alhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-12-15 15:36:12.378  INFO 3464 --- [ost-startStop-1] o.s.web.context.Context
Loader            : Root WebApplicationContext: initialization completed in 3689
 ms
2017-12-15 15:36:12.550  INFO 3464 --- [ost-startStop-1] o.s.b.w.servlet.Servlet
RegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-12-15 15:36:12.550  INFO 3464 --- [ost-startStop-1] o.s.b.w.servlet.FilterR
egistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-12-15 15:36:12.550  INFO 3464 --- [ost-startStop-1] o.s.b.w.servlet.FilterR
egistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-12-15 15:36:12.550  INFO 3464 --- [ost-startStop-1] o.s.b.w.servlet.FilterR
egistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-12-15 15:36:12.550  INFO 3464 --- [ost-startStop-1] o.s.b.w.servlet.FilterR
egistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-12-15 15:36:13.070  INFO 3464 --- [       runner-0] s.w.s.m.m.a.RequestMapp
ingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.
servlet.context.AnnotationConfigServletWebServerApplicationContext@48cd5e87: sta
rtup date [Fri Dec 15 15:36:08 IST 2017]; root of context hierarchy
2017-12-15 15:36:13.200  INFO 3464 --- [       runner-0] s.w.s.m.m.a.RequestMapp
ingHandlerMapping : Mapped "{[/]}" onto public java.util.Map HelloWorld.home()
2017-12-15 15:36:13.209  INFO 3464 --- [       runner-0] s.w.s.m.m.a.RequestMapp
ingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.Res
ponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframewo
rk.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet
.http.HttpServletRequest)
2017-12-15 15:36:13.209  INFO 3464 --- [       runner-0] s.w.s.m.m.a.RequestMapp
ingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.spr
ingframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web
.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequ
est,javax.servlet.http.HttpServletResponse)
2017-12-15 15:36:13.242  INFO 3464 --- [       runner-0] o.s.w.s.handler.SimpleU
rlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class or
g.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-12-15 15:36:13.242  INFO 3464 --- [       runner-0] o.s.w.s.handler.SimpleU
rlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.spring
framework.web.servlet.resource.ResourceHttpRequestHandler]
2017-12-15 15:36:13.289  INFO 3464 --- [       runner-0] o.s.w.s.handler.SimpleU
rlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [clas
s org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-12-15 15:36:13.976  INFO 3464 --- [       runner-0] o.s.j.e.a.AnnotationMBe
anExporter        : Registering beans for JMX exposure on startup
2017-12-15 15:36:14.170  INFO 3464 --- [       runner-0] o.s.b.w.embedded.tomcat
.TomcatWebServer  : Tomcat started on port(s): 8080 (http)
2017-12-15 15:36:14.175  INFO 3464 --- [       runner-0] o.s.boot.SpringApplicat
ion               : Started application in 8.06 seconds (JVM running for 77.714)

2017-12-15 15:37:42.225  INFO 3464 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[loc
alhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-12-15 15:37:42.226  INFO 3464 --- [nio-8080-exec-1] o.s.web.servlet.Dispatc
herServlet        : FrameworkServlet 'dispatcherServlet': initialization started

2017-12-15 15:37:42.249  INFO 3464 --- [nio-8080-exec-1] o.s.web.servlet.Dispatc
herServlet        : FrameworkServlet 'dispatcherServlet': initialization complet
ed in 23 ms

暂无
暂无

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

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