简体   繁体   中英

install spring boot CLI in windows 7

I would like to set up a dev environment on my Windows 7 machine so i can create a spring-boot application. However, i'm having a hard time installing Spring-boot on windows.

This is what i have done so far: -Downloaded spring-boot CLI zip package and unzipped in C drive -JAVA_HOME variable set to c:\\Program Files (x86)\\Java\\jdk1.6.0_14 -SPRING_HOME variable set to C:\\spring-1.3.0.BUILD-SNAPSHOT -Added SPRING_HOME/bin to PATH environment variable

It says to add symlink to auto-completion script but i do not know how to do that. Not surprisingly when i test installation with "spring --version" command, it fails.

Anybody has done this before?

Thanks!

Instructions for setup are bit misleading for path setup.

For Windows, Environment variables section, need use %SPRING_HOME%\\bin referencing in place of SPRING_HOME/bin for the system to pick up SPRING_HOME environment variable.

Where SPRING_HOME is an environment variable for specifying path to the spring boot directory. Eg :- C:\\Program Files\\Spring\\spring-1.2.7.RELEASE

Note: bin folder is not included in the SPRING_HOME .

I was able to get it up, here are screen grabs of process. 在此输入图像描述

Alternatively you can have the path setup directly without SPRING_HOME, just append the environment variable path with directory path of your "spring.bat" file C:\\Program Files\\Spring\\spring-1.2.7.RELEASE\\bin; .

Windows looks in the current directory before searching the path. So, when you're in the bin directory it sees the spring command there and does not look at the path.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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