Springboot Getting Started note (iii), hot load

Source: Internet
Author: User

1, configure the hot load environment, add the following code in Pom.xml

<Build>    <!--Springloader Plugin -    <Plugins>        <plugin>            <groupId>Org.springframework.boot</groupId>            <Artifactid>Spring-boot-maven-plugin</Artifactid>            <Dependencies>                <Dependency>                    <groupId>Org.springframework</groupId>                    <Artifactid>springloaded</Artifactid>                    <version>1.2.7.RELEASE</version>                </Dependency>            </Dependencies>            <executions>                <Execution>                    <Goals>                        <goal>Repackage</goal>                    </Goals>                    <Configuration>                        <classifier>Exec</classifier>                    </Configuration>                </Execution>            </executions>        </plugin>    </Plugins>  </Build>

2. Run as->maven Build

3, operation, error

java.lang.unsupportedclassversionerror:com/learn/spring_boot_hello/app:unsupported Major.minor version 52.0at Java.lang.ClassLoader.defineClass1 (Native Method) at Java.lang.ClassLoader.defineClass (classloader.java:800) at Java.security.SecureClassLoader.defineClass (secureclassloader.java:142) at Java.net.URLClassLoader.defineClass ( urlclassloader.java:449) at java.net.urlclassloader.access$100 (urlclassloader.java:71) at java.net.URLClassLoader$ 1.run (urlclassloader.java:361) at Java.net.urlclassloader$1.run (urlclassloader.java:355) at Java.security.AccessController.doPrivileged (Native Method) at Java.net.URLClassLoader.findClass ( urlclassloader.java:354) at Java.lang.ClassLoader.loadClass (classloader.java:425) at sun.misc.launcher$ Appclassloader.loadclass (launcher.java:308) at Java.lang.ClassLoader.loadClass (classloader.java:358) at Sun.launcher.LauncherHelper.checkAndLoadMain (launcherhelper.java:482) Exception in thread "main" [INFO]------------ ------------------------------------------------------------ 

4. Open the Run Configuration

Modify to JRE1.8
5. Modify the Code

6. Refresh the page

7, this time rerun the program prompt port is occupied, need to use another method

Add in app (need to implement create Lib directory and copy the jar package because the Maven Jar package physical path is not in the project)
-javaagent:.\lib\springloaded-1.2.7.release.jar-noverify

8. Successful operation

Summary: In fact, this method is not the simplest, the use of Jrebel is better than this, and more general.

Springboot Getting Started note (iii), hot load

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.