0

I am working on a small project that reads xml files, extracts and writes relevant data into excel files. There are many different projects in the repository where I need to write this code, mainly using Maven and Spring. I wrote a simple class to read xml file from file system using 'File', 'DocumentBuilderFactory' and 'DocumentBuilder' classes. Added a main() method to execute the code but while executing it is giving following error -

Error:java: invalid target release: ${jdk.version}

Can I execute simple java classes (using p s v m) from withing maven or spring projects?

Just to add, I am using IntelliJ ultimate 2017.2 and under project structure, jdk 1.8 is set. I have another project based on maven (Cucumber + Selenium) that executes perfectly fine in Intellij without any error.

Thanks

ShuchiD
  • 31
  • 1
  • 1
  • 5
  • 1
    Possible duplicate of [invalid target release: 1.7](https://stackoverflow.com/questions/19891423/invalid-target-release-1-7) – Unknown Jan 30 '18 at 07:40
  • Also Refer https://stackoverflow.com/questions/28291691/fatal-error-compiling-invalid-target-release-1-8-help-1 – Unknown Jan 30 '18 at 07:41
  • I have another project based on maven (Cucumber + Selenium) that executes perfectly fine in Intellij without any error. – ShuchiD Jan 30 '18 at 08:29

1 Answers1

0

In Intellij -> Settings window, Java Compiler (Target bytecode version) was set to ${jdk.version}. changed it to 1.8 and that resolved this error.

ShuchiD
  • 31
  • 1
  • 1
  • 5