The project can't be build with jdk8
gaoxingliang opened this issue · 4 comments
gaoxingliang commented
This project can't be build on jdk8 when running mvn jetty:run -Pfrontend
:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 1.8.0-202 is not in the allowed range [1.7,1.8).
my jdk version is:
➜ webmvc25 git:(master) ✗ java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b31)
Java HotSpot(TM) GraalVM EE 19.0.0 (build 25.212-b31-jvmci-19-b01, mixed mode)
A quick work around is changing the pom.xml:
<requireJavaVersion>
<version>1.7</version> // before is [1.7, 1.8)
</requireJavaVersion>
codefromthecrypt commented
webmvc25 was intentionally made to show we can work on old JDK. I
guess we can relax the requirement if it works with JDK 1.8.
gaoxingliang commented
I test, it can start it up. but it has another problem on jdk8, it seems the project webmvc can't run on jdk8.
Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
at org.springframework.context.config.ContextNamespaceHandler$1.parse (ContextNamespaceHandler.java:65)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse (NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement (BeanDefinitionParserDelegate.java:1297)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement (BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions (XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:143)
So I think we can't fix this by just changing the pom.xml. as you said, it can only support on 1.7. is that right? We'd better add this constraint in the README.md
codefromthecrypt commented
yeah I think spring 2.5 doesn't work on JDK 8 as this project is setup
anyway.. I think it is best to use one of the other examples
…On Thu, Jun 27, 2019 at 7:33 PM Edward Gao ***@***.***> wrote:
I test, it can start it up. but it has another problem on jdk8, it seems
the project webmvc can't run on jdk8.
Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
at org.springframework.context.config.ContextNamespaceHandler$1.parse (ContextNamespaceHandler.java:65)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse (NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement (BeanDefinitionParserDelegate.java:1297)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement (BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions (DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions (XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:143)
So I think we can't fix this by just changing the pom.xml. as you said, it
can only support on 1.7. is that right?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#32>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAPVV6K4I2BD3J5QOBHYMLP4SQPJANCNFSM4H32IJBA>
.
codefromthecrypt commented
building is now verified on docker. running may still be limited wrt JRE, but the intended target JREs are also enforced in docker images https://hub.docker.com/repository/docker/openzipkin/example-brave