Skip to content

Instantly share code, notes, and snippets.

@mraible
Last active April 3, 2019 21:28
Show Gist options
  • Save mraible/716f4d2ab205c0e747d51119fc5d9cd8 to your computer and use it in GitHub Desktop.
Save mraible/716f4d2ab205c0e747d51119fc5d9cd8 to your computer and use it in GitHub Desktop.
JHipster v5 with Java 10

Thanks to Josh Long's Java 10 blog post for instructions!

  1. Download and install Java 10. Make sure it's the version used when you run java -version.

  2. Clone the JHipster project's master branch:

    git clone https://github.com/jhipster/generator-jhipster.git
    
  3. In the cloned directory, run npm link.

  4. Create a new directory and project in it by running jhipster. Choose Maven as your build tool.

  5. Modify pom.xml:

    1. Change java.version to be "10".

    2. Confirm you have a dependency on JAXB.

      <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
      </dependency>
    3. Change the maven-enforcer-plugin to remove the <requireJavaVersion> block:

      <requireJavaVersion>
          <message>You are running an incompatible version of Java. JHipster requires JDK ${java.version}</message>
          <version>[1.8,1.9)</version>
      </requireJavaVersion>
  6. Download and install IntelliJ IDEA 2018.1.

  7. Open the project in IntelliJ, add Java 10 as an SDK, and run the Application.java class.

  8. Enjoy the sweet smell of success! 🤓

@pgesek
Copy link

pgesek commented Oct 17, 2018

For anyone struggling with Maven - I was only able to get it compile after I added the javax.xml dependencies as annotationProcessorPaths for the compiler plugin

         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!-- For JPA static metamodel generation -->
                        <path>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>${hibernate.version}</version>
                        </path>
                        <path>
                            <groupId>javax.xml.bind</groupId>
                            <artifactId>jaxb-api</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                        <path>
                            <groupId>com.sun.xml.bind</groupId>
                            <artifactId>jaxb-core</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                        <path>
                            <groupId>com.sun.xml.bind</groupId>
                            <artifactId>jaxb-impl</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

@Totot0
Copy link

Totot0 commented Apr 3, 2019

I used the method shown above that is Java 10 and clonnage of the repo git. But when I create my micro service the package util in rest does not generate. The class pagination and header are not generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment