web-dev-qa-db-fra.com

Impossible d'exécuter Java 11 dans intellij

public class First {
  public static void main(String[] args) {
    System.out.println("Hello Java 11");
  }
}

J'essaie d'exécuter le programme ci-dessus dans Java 11 avec intellij. Mais en dessous de Error.

Information:javac 11 was used to compile Java sources
Information:Internal caches are corrupted or have outdated format, forcing project rebuild: Module 'eleven-lab' production: Java.net.MalformedURLException: unknown protocol: jrt
Information:25/09/18, 6:58 PM - Compilation completed with 1 error and 0 warnings in 4s 516ms
Error:Internal error: (Java.net.MalformedURLException) unknown protocol: jrt
Java.net.MalformedURLException: unknown protocol: jrt
    at Java.net.URL.<init>(URL.Java:421)
    at Java.net.URL.<init>(URL.Java:310)
    at Java.net.URL.<init>(URL.Java:333)
    at com.intellij.compiler.instrumentation.InstrumentationClassFinder.createJDKPlatformUrl(InstrumentationClassFinder.Java:61)
    at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.createInstrumentationClassFinder(ClassProcessingBuilder.Java:125)
    at org.jetbrains.jps.incremental.instrumentation.ClassProcessingBuilder.build(ClassProcessingBuilder.Java:93)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.Java:1246)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.Java:923)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.Java:995)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.Java:886)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.Java:719)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.Java:371)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.Java:178)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.Java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.Java:308)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.Java:138)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.Java:235)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.Java:42)
    at Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:511)
    at Java.util.concurrent.FutureTask.run(FutureTask.Java:266)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
    at Java.lang.Thread.run(Thread.Java:745)
Please perform full project rebuild (Build | Rebuild Project)

Java: openjdk-11 + 28_osx-x64_bin.tar.gz

os: macOS 10.13.2

intellij: ideaIC-2018.2.4

13
shubham12511

Java 11 est encore très nouveau.

Je soupçonne que les caches d'IntelliJ ont été corrompues et leur nettoyage devrait aider.

Je voudrais également tenir à jour Intellij si vous utilisez un nouveau JDK.

11
Peter Lawrey

Même erreur ici, mise à niveau vers intellij 2018.1 et l'erreur a disparu.

4
j.e.