zoukankan      html  css  js  c++  java
  • SpringBoot项目启动

    SpringBoot项目与其他项目启动方式有些不同。

    查看是否是SpringBoot项目,可以查看在项目的pom.xml中是否有引入SpringBoot:

    上图中就是对应的spring-boot。若有则为springboot项目。

    正题:启动springboot项目:

    (1)maven install 项目(与其他项目相同,不再赘述)

    (2)maven install项目后会发现有一个jar包,如下图中所示:

    cmd进入此目录:

    直接 java -jar 包名  启动项目。

    若无法启动,发现如下提示:

    这是因为80端口被占用了。

    可以利用如下命令查看是被什么占用了:

    netstat -ano|findstr "80"   (查看端口被什么占用了,可以其进程的pid)

    上图中我们发现PID为3600,下面输入如下命令进行查看是什么进程在占用:

    tasklist|findstr "3600"

     

    如果这个进程没有必要需要,大家直接kill pid 就可以了。

    但是我这里的这个进程必须要使用,这个时候我们就需要启动的时候去指定端口号了,如下命令:

    java -jar xxx.jar --server.port 8080

    这样,我们就使用8080端口启动了。

     直接使用http://localhost:8080 进行访问即可。

  • 相关阅读:
    Leetcode#145 Binary Tree Postorder Traversal
    Leetcode#146 LRU Cache
    单引号和双引号的区别
    $* $@ $#
    pthread_detach
    pthread_join
    intent 启动activity、service的方法
    multicast based on udp
    ARM指令系统
    ARM寄存器
  • 原文地址:https://www.cnblogs.com/bingoTest/p/11233245.html
Copyright © 2011-2022 走看看