Skip to content
CCPEDIAby Unity Nodes
App Development

Sandbox error -- multiple java versions on Windows

15 posts944 views3 likesLast activity Mar 2023

  1. harikrishna_sri_ramoOP

    Hi ,

    When I am using openJDK Java in one machine sandbox is working fine .
    But when I am using SDK in the machine with java from oracle provider I am getting following error.
    Caused by: java.lang.UnsupportedClassVersionError: com/github/blemale/scaffeine/CacheLoaderAdapter has been compiled by a more
    recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    Is there any dependency to use only OpenJDK. ?

    Note :In both machines SDK version is 2.1.1 and java version is 11.0.8

    Regards
    Harikrishna

  2. cocreature

    Class file version 52.0 is Java 8. So it sounds like your oracle JDK somehow is version 8 rather than 11.0.8.

    How are you starting Sandbox?

    Can you check the output of these two commands:

    java -version
    echo $JAVA_HOME
    
  3. harikrishna_sri_ramo

    Hi ,

    Thanks for the response.

    I am starting the sandbox using DAML START.

    below is the output for java -version

    java version “11.0.18” 2023-01-17 LTS
    Java™ SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)
    Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.18+9-LTS-195, mixed mode)

    below is the output for next command
    echo $JAVA_HOME
    $JAVA_HOME

    Regrds
    Harikrishna

  4. cocreature

    Which operating system are you running on?

  5. harikrishna_sri_ramo

    windows 10

  6. cocreature

    Can you please run this from the same powershell session you’re running Daml start from:

    echo $Env:PATH
    echo $Env:JAVA_HOME
    
  7. harikrishna_sri_ramo

    below is the result of the commands

    PS H:> echo $Env:PATH

    C:\Program Files\Common Files\Oracle\Java\javapath;

    C:\WINDOWS\CCM;

    C:\WINDOWS\system32;

    C:\WINDOWS;

    C:\WINDOWS\System32\Wbem;

    C:\WINDOWS\System32\WindowsPowerShell\v1.0;

    C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;

    C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;

    C:\Program Files\git\bin;

    C:\Program Files (x86)\Webex\Plugins;

    C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm;

    C:\Program Files\nodejs\16.17.1;

    ;C:\Program Files\org1\VSCode\1.74.2\bin;

    C:\Program Files\org1\VSCode\1.74.2;

    C:\Users\username\AppData\Local\Microsoft\WindowsApps;

    C:\Program Files\Java\jdk11\bin;

    C:\Users\username\AppData\Roaming\daml\bin;

    PS H:> echo $Env:JAVA_HOME

    C:\Program Files\Java\jdk11\bin

  8. Mate_Varga

    Hi @harikrishna_sri_ramo,

    Could you please check that java.exe is not present in your C:\WINDOWS\System32 folder? Do you have System Administrator rights on the machine you get this error?

  9. harikrishna_sri_ramo

    Hi @Mate_Varga

    I don’t have system rights .
    Java.exe is present in the the mentioned folder

    Regards
    Harikrishna

  10. Mate_Varga

    The question is not whether or not do you have java.exe installed, it is whether or not do you have a system managed version of it in your C:\WINDOWS\System32. If you do, that takes over the precedence whenever you run the daml assistant and it calls out to execute jars, but does not do when you execute from your interactive session.

  11. harikrishna_sri_ramo

    Hi @Mate_Varga

    Thanks for the response .
    Could you please elaborate , I am unable to understand your point clearly.
    I don’t have system admin rights.
    There are three files java.exe javaw.exe javaws.exe files.

    Regards
    Harikrishna

  12. cocreature 1

    Can you run

    C:\WINDOWS\System32\java.exe -version
    
  13. harikrishna_sri_ramo

    Hi @cocreature
    Thank for the response.
    below is the output

    java version “1.8.0_351”
    Java™ SE Runtime Environment (build 1.8.0_351-b25)
    Java HotSpot™ 64-Bit Server VM (build 25.351-b25, mixed mode)

    Regards
    Harikrishna

  14. cocreature 2

    There is your issue. It looks like that’s the Java version that is being picked up. Can you reach out to whoever has admin rights on your machine and ask them to remove this version?

  15. harikrishna_sri_ramo

    Thank you very much for your support.