Server issue (Java jdk)

I have deployed openmrs 1.9.7 on tomcat but I keep getting this error below no matter what jdk I try to use. I have even tried to use jdk 6 but still got nothing.

Please help.

OpenMRS is not able to start. The following error occurred at startup: OpenMRS requires Java 6, but is running under 1.8.0_341

org.openmrs.api.APIException: OpenMRS requires Java 6, but is running under 1.8.0_341 at org.openmrs.util.OpenmrsUtil.validateJavaVersion(OpenmrsUtil.java:1204) at org.openmrs.web.Listener.contextInitialized(Listener.java:120) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5128) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5653) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1007) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1128) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)

If you’re getting that error, it’s because whatever method you are using to run OpenMRS is using Java 8 rather than Java 6. Usually, the version of Java Tomcat uses is controlled through the JAVA_HOME environment variable, so you need to ensure that that is pointing to Java 6 and not Java 8.

1 Like