IDEA with openjdk9 produces a "cannot resolve character" error

I am using openjdk9 on Ubuntu:

openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b134-2ubuntu1)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b134-2ubuntu1, mixed mode)

And it’s obvious that JDK9 no longer has CLASS_PATH, tools.jar and rt.jar, so I ran into the problem of how to import these classes into my project.

public class FoolsDay {
    public static void main(String[] args) {
        System.out.println("Ahh, don't know how to use jdk9!");
    }
}

Even the simplest code will not work, for this there is no class called Systemand String.

However, the IDE still generated codes without any errors, but it did not start because the "do not resolve character" problem does not allow finding the main method in this class.

But when I compile and run the code in the terminal with javacand java, it works fine.

+4

Source: https://habr.com/ru/post/1673797/


All Articles