title: Unable to start web server; nested exception is java.lang.IllegalStateException
body: <p>created a spring application via start.spring.io and I try to run the application but an error occurs:</p>
  <blockquote>
  <p>org.springframework.context.ApplicationContextException: Unable to
  start web server; nested exception is java.lang.IllegalStateException:
  Temp directory 'C:\WINDOWS\TEMP' does not exist   at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
  ~[spring-context-5.3.10.jar:5.3.10]   at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  com.studentex.student.StudentApplication.main(StudentApplication.java:10)
  ~[classes/:na]    at
  java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method) ~[na:na]  at
  java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ~[na:na]  at
  java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ~[na:na]  at
  java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
  at
  org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  ~[spring-boot-devtools-2.5.5.jar:2.5.5] Caused by:
  java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does
  not exist     at org.springframework.util.Assert.state(Assert.java:97)
  ~[spring-core-5.3.10.jar:5.3.10]  at
  org.springframework.boot.system.ApplicationTemp.getTempDirectory(ApplicationTemp.java:125)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.system.ApplicationTemp.getPath(ApplicationTemp.java:96)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.system.ApplicationTemp.getDir(ApplicationTemp.java:89)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.servlet.server.SessionStoreDirectory.getValidDirectory(SessionStoreDirectory.java:46)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:288)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:284)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configurePersistSession(TomcatServletWebServerFactory.java:416)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureSession(TomcatServletWebServerFactory.java:406)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureContext(TomcatServletWebServerFactory.java:383)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.prepareContext(TomcatServletWebServerFactory.java:246)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:198)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182)
  ~[spring-boot-2.5.5.jar:2.5.5]    at
  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)
  ~[spring-boot-2.5.5.jar:2.5.5]    ... 13 common frames omitted</p>
  </blockquote>
  <p>my code is here:</p>
  <pre><code>@SpringBootApplication
  public class StudentApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(StudentApplication.class, args);
      }
  
  }
  </code></pre>