No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

后端 未结 30 2530
盖世英雄少女心
盖世英雄少女心 2020-11-22 15:40

I\'m compiling a project in Eclipse using m2eclipse. I set the JDK path in Eclipse like this:

Windows-->preferences-->installed jres--> jdk1.7.xx  p         


        
30条回答
  •  爱一瞬间的悲伤
    2020-11-22 16:25

    There are several answers regarding this question but all are related to right path configuration of JDK, but with JRE only we can solve this problem.

    We just need to make use of deployment assembly to configure the path of packaged war file of the Java EE Project and then re-run the maven-install.

    Steps to make use of deployment assembly:

    1. Right click on the Jave EE project --> click on Properties --> click on Deployment Assembly

    2. Click on Add button --> Click on Archives from the File System --> Click on next --> Click on Add --> Go to the .m2\respository directory and search for the war file generated --> Select war file --> Click on Open button --> Click on Apply --> OK

    3. Right click on the project --> Click on Maven Install under Run As

    This will build your project successfully, without any compiler error.

    Hope this solves the problem without JDK.

提交回复
热议问题