-2

I am trying to get familiar with Jhipster and I am having this error when I run my first mvnw is anyone had this already?:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/wrapper/MavenWrapperMain : Unsupported major.minor version 51.0

I created the project by generating the sources on a github account.

Thanks for your help

Spiiff77
  • 55
  • 9
  • Do you have a pom.xml in your project? If so, you could try by specify 1.6 as "source" and "target" for the Maven entry. – Andrea Jan 05 '18 at 15:04

1 Answers1

2

The error in this case means that Maven has classes compiled with Java 7, and thus needs Java 7 or higher (version 51.0), it seems you use JDK 1.6. Additionally, JHipster requires JDK 8 so the solution is to upgrade to JDK 8.

If you're on Mac OSX check Installed Java 7 on Mac OS X but Terminal is still using version 6

Gaël Marziou
  • 16,028
  • 4
  • 38
  • 49
  • Thank you for your answer, I installed JDK9 (I had 8 actually, but still...) . Java - version is giving me : java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) and I still have the error, is it normal? – Spiiff77 Jan 05 '18 at 18:09
  • JHipster does not support JDK 9. Which OS? – Gaël Marziou Jan 05 '18 at 18:12