Search code examples
javaconsoleopenjdk-11

can't run a jar with java 11


I have a compiled jar with version 11, but when I open it nothing happens, and through the command line I get an error: Error: could not open `C:\Program Files\Java\jre1.8.0_291\lib\amd64\jvm.cfg' I uninstalled jre 8 so that it would run on 11. PATH JAVA_HOME Path

how can I make the console and jar act with java 11?


Solution

  • Try:

    1. Windows Search Bar -> "environment variables"
    2. Click on the button "Environment Variables..."
    3. Double click the button "Path" under system variables window
    4. Create a new variable and select the path to jdk11 and move it to the top of the window(or above the other java versions you have)
    5. Tell me if it works! :)