springboot_工程部署

1.打包可执行jar工程文件:

工程右键->run as->maven build:

maven package

2.问题:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Window->preferences->Java->Installed JREs->Add->Standard VM->next->Directory->JDK root路径->Finish->[Installed JREs勾选添加的JDK]

Window->preferences->Java->Installed JREs->Execution Environments->JavaSE-1.8->[勾选JDK]

3.打包jar的pom配置:


  
    
      org.springframework.boot
      spring-boot-maven-plugin
      
        
          
            repackage
          
        
      
    
  

4.执行jar包:

#开放端口
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

#执行jar包
java -jar package.jar

 

你可能感兴趣的:(springboot)