-2

I am so frustrated right now. I was trying to follow this tutorial https://www.callicoder.com/java-read-write-csv-file-opencsv/ to use openCSV in java to read some file. After I set up every thing. I got these error. I got some error like this

I got some error like this

And, then I did some research. And I follow the answer https://stackoverflow.com/a/42929382/8371801

Now my pom look like this enter image description here

Then the problem fixed. Every thing works perfect. So I just want to know what happened. What does pom file exactly do? What does Maven exactly do? I did many researches on line but I am still so confused. Why my java version is 10.1 it still work when I enter 1.8 in pom.

LOTR94
  • 27
  • 7
  • 1
    Please, NO CODE IMAGES. Copy/paste all relevant text from your IDE and include it as TEXT (code-formatted where appropriate). Please visit the [help] and read [ask] to learn how to use this site effectively. Also, before asking "What does POM do", please do some research to understand what Maven is and how it works. – Jim Garrison Apr 30 '18 at 23:33

2 Answers2

0

Maven does many things. In your case it downloads the opencsv library for you and invokes javac for you.

The properties you've set in your pom.xml (one of maven's configuration files) control whats passed in javac's -source and -target options.

larsgrefer
  • 2,735
  • 19
  • 36
0

Essentially thru maven you have defined what version of java to use. You can also do the same kind of thing going to the modules->dependencies in the module settings.

A useful link Difference between intellij Project make and Maven Compile?

wmitchell
  • 5,665
  • 10
  • 37
  • 62