spring微服务迁移到eclipse上运行

因为原来在idea上运行,但是由于其收费,作为个人不愿意花钱,再加上近期idea频繁的出现cpu百分之百,所以准重新使用eclipse,遇到一些问题,在此记录:

1、eclipse的spring环境配置

市场上安装的插件:

spring微服务迁移到eclipse上运行_第1张图片

从地址安装的ide工具:

http://dist.springsource.com/release/TOOLS/update/e4.20/

spring微服务迁移到eclipse上运行_第2张图片spring微服务迁移到eclipse上运行_第3张图片

spring微服务迁移到eclipse上运行_第4张图片

2、spring工程的导入

采用maven包的导入

3、debug启动

spring微服务迁移到eclipse上运行_第5张图片

 报错1:Cannot load configuration class: org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration

原因:java8和openjava11的不同环境导致

解决方案:修改对应的jar

openJdk11没有jre文件夹,生成命令:

 D:\dev\jdk-11>bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre

配置eclipse环境:

spring微服务迁移到eclipse上运行_第6张图片

spring微服务迁移到eclipse上运行_第7张图片

spring微服务迁移到eclipse上运行_第8张图片

spring微服务迁移到eclipse上运行_第9张图片

 ERROR: This jdwp native library will not work with this VM's version of JVMTI (11.0.0), it needs JVMTI 17.0[.0].

解决办法,查看上边的环境配置,原来配置错了出现了这个错误

报错2:java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present

原因:java9以后引入了模块化的概念,添加依赖:


        javax.xml.bind
        jaxb-api
        2.3.0
   

   
        com.sun.xml.bind
        jaxb-impl
        2.3.0
   

   
        org.glassfish.jaxb
        jaxb-runtime
        2.3.0
   

   
        javax.activation
        activation
        1.1.1
   

参考:https://blog.csdn.net/weixin_45012575/article/details/100548253

以上,启动成功。

你可能感兴趣的:(java开发,eclipse,spring,微服务)