Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run a JHipster app on Ubuntu with Java 11?

I'm trying to run an app generated by JHipster 5.7. When I try to run the mnvw file, I get:

[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
You are running an incompatible version of Java. JHipster requires JDK 1.8

followed by a string of errors and a failure to run. I am indeed using JDK version 11. I've found some seemingly relevant information online but it's very difficult for me to really understand what any of it means, or even be entirely sure if it's relevant to my problem.

To avoid an XY problem I'm just going to ask my question in the most general, nooby way possible: how can I run a JHipster 5 app on Ubuntu (18.10) when I have JDK 11 installed? (If the answer is to install a different version of Java this is fine, but I don't know how to do this or how to tell JHipster to use that version).

like image 510
Jack M Avatar asked Nov 07 '22 23:11

Jack M


1 Answers

Am testing my generated app with Java 11 and it works without problems.

Just update the pom like this :

  1. Java version : <java.version>11</java.version>
  2. Spring Boot version : <spring-boot.version>2.1.2.RELEASE</spring-boot.version>
  3. Add jaxb dependencies :

    <dependency>
         <groupId>org.glassfish.jaxb</groupId>
         <artifactId>jaxb-runtime</artifactId>
         <version>2.3.2</version>
    </dependency>
    
  4. Comment or Remove maven-enforcer-plugin requireJavaVersion rule.

  5. mvn clean build

My Env : Windows 10 64-bit, OpenJDK 11.0.1 64-bit, Apache Netbeans 10, Maven 3.5.2, Spring Boot 2.1.2.RELEASE

like image 145
mtbadi39 Avatar answered Nov 09 '22 13:11

mtbadi39