JavaCoreEnvironment does work in an old version, but throws exception in the current version
I was able to pin the issue I reported here down. To demonstrate the behavior I have set up a minimal example that uses JavaCoreApplicationEnvironmen and JavaCoreProjectEnvironment. The example consists only of one class IntelliJ-Core-Environment-Test/simple-parser/src/Main.java that parses sucessfully a sample java file.
The thing with this project is that it depends on the module intellij-plattform which is a collection of file from an older version of the API. So when you compile and run the Main.java, then it depends partly on the old intellij files that are used prior the intellij libraries. You can see in the module-dependency settings for simple-parser that the intellij-plattform comes before the idea-libs
Now, technically this all isn't necesarry, because all functionality can be found in the libraries that come with IDEA. Therefore, please delete the dependency "intellij-plattform" and "idea-libs" and add a new library directory that points to the "lib" folder of your installation of IDEA
You can now build the simple-parser module as well without errors, but when you run it, you get the exception I have already reported.