Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java installation not found

    I am trying to install a command (Stata 17) but I receive a message that

    . ssc install chi2power
    Java installation not found
    r(5004);

    Could you please help me to solve this problem?

  • #2
    On your system, run the Stata command java query and in the Stata Results window, copy the command and its output and paste it into a reply. Please surround your pasted material with code delimiters [CODE] before and [/CODE] after the copied material.

    Code:
    . java query
    ------------------------------------------------------------------------------------------------
        Java settings
          set java_heapmax     4096m
          set java_home        /Applications/Stata/utilities/java/macosx-x64/zulu-jdk11.0.13/
    
        Java system information
          initialized          yes
          heap usage           7m
          heap committed       30m
          runtime vendor       Azul Systems, Inc.
          runtime version      11.0.13+8-LTS
          system classpath     /Applications/Stata/utilities/jar/aspose-words-18.11-jdk16.jar:/Appli
    > cations/Stata/utilities/jar/libstata-core.jar:/Applications/Stata/utilities/jar/libdeps-core.j
    > ar:/Applications/Stata/utilities/jar/sfi-api.jar:
          javacall classpath   
          library path         /Applications/Stata/utilities/java/macosx-x64/zulu-jdk11.0.13/lib/jli
    > /libjli.dylib
    
    .

    Comment


    • #3
      I have run the command
      java query

      the result is that

      . java query
      ---------------------------------------------------------------------------------------------------------
      Java settings
      set java_heapmax 4096m
      set java_home C:\Program Files\Stata17\utilities\java\windows-x64\zulu-jdk11.0.11\

      Java system information
      initialized no
      library path C:\Program Files\Stata17\utilities\java\windows-x64\zulu-jdk11.0.11\bin\server
      > \jvm.dll


      Comment


      • #4
        Supposedly initialization happens automatically; but try
        Code:
        java initialize
        java query
        and see if that helps.

        Comment


        • #5
          An alternative would be to download another version of JDK from "Java Archive Downloads - Java SE 17 (oracle.com)". Extract the .zip file and copy paste the contents in the Stata 17 installation folder. You will then need to set Stata for using this version of jdk by
          Code:
          set java_home "Path to the extracted folder in the Stata 17 installation folder"
          The
          Code:
           ssc install chi2power
          command should work after this.

          Comment


          • #6
            I would not recommend installing an alternative version of Java unless you want to maintain your Java installation yourself, rather than have Stata take care of it as part of its update procedures. And the version of Java reported by java query suggests that you have not updated your installation of Stata 17 since 14 June 2021 which was when Stata made 11.0.11 the current version; you can see that my version is at 11.0.13, which was released in the 11 November 2021 update to Stata.

            So if the manual initialization suggested above doesn't resolve the problem, I would advise that the next step is to
            Code:
            update all
            and perhaps the update process will take care of your Java problem.

            If not, my next advice would be to contact Stata Technical Services at

            https://www.stata.com/support/tech-support/

            and seek their advice. You're entitled to it as part of your Stata license.

            Comment


            • #7
              . set java_home "C:\Users\ramfa\Desktop\jdk-17_windows-x64_bin\jdk-17.0.2\bin\java.exe"

              C:\Users\ramfa\Desktop\jdk-17_windows-x64_bin\jdk-17.0.2\bin\java.exe is not a valid path.
              r(601);

              Comment


              • #8
                when I use about command I can see that
                Revision 16 Dec 2021

                Comment


                • #9
                  I have updated Stata 17. It is now Revision 17 Jan 2022.
                  However, I still receive

                  . ssc install chi2power
                  Java installation not found
                  r(5004);

                  Comment


                  • #10
                    Download Stata installation qualification tool from https://www.stata.com/support/instal...qualification/
                    and run it, report back if all qualifications pass or some fail.

                    Comment


                    • #11
                      Please have a look at the attached file.
                      Please note that I use Windows 11
                      Attached Files

                      Comment


                      • #12
                        As the iqt.pdf suggested, your Stata MP executable is out of date. Launch StataMP, then type

                        Code:
                        update all
                        and follow the instructions. Make sure after the update, in Stata,

                        [/CODE]
                        query compilenumber
                        [/CODE]

                        reports "Compile number 170112". report back if any error during update.

                        Comment


                        • #13
                          I have done it. The report is attached.
                          Attached Files

                          Comment


                          • #14
                            Now the installation is good. Do you still have problem when try

                            Code:
                             
                             ssc install chi2power
                            If the problem persists, please contact us at [email protected]

                            Comment


                            • #15
                              I still receive the same message

                              Java installation not found
                              r(5004);

                              However, I would like to mention that when I click on Stata icon to open it, I receive a security alert from McAfee Endpoint Security. I have add Stata in the Exclusions (setting in McAfee). Could McAfee affect Stata?

                              Comment

                              Working...
                              X