0

I am trying to compile my project.

Ant version is: Apache Ant(TM) version 1.10.8

I run first ant in a folder with build.xml

Then I compile: java -jar asp.jar easter.asp

java -version: java "11.0.1" javac - version: javac 11.0.1

Then I get this error message: has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0

How do I resolve this issue? I am also currently using Macbook Pro, and I get same problem when compiling on Visual Studio Code and terminal Window

dmt
  • 11
  • 2
  • you'll need to install a newer version of the jre. It's like trying to run code containing streams on java 6. the java 6 environment doesn't know about streams, so can't execute the code – Stultuske Aug 31 '20 at 13:15
  • Does this answer your question? [Class has been compiled by a more recent version of the Java Environment](https://stackoverflow.com/questions/47457105/class-has-been-compiled-by-a-more-recent-version-of-the-java-environment) – Strikegently Aug 31 '20 at 13:21

1 Answers1

0

You should replace java with your JDK's path. I use it while launching .jar files since I have a JDK 14 and JRE 8. Should be something like this: "C:/Program Files/Java/jdk-version/bin/java.exe" -jar asp.jar easter.asp. Edit: I just noticed you are a Mac user but I am pretty sure you can find your JDK's path. Edit #2: Also, you need JDK 14 as well, since the 58 version refers to JDK 14.

Dharman
  • 30,962
  • 25
  • 85
  • 135
scaldings
  • 33
  • 4