Announcement

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

  • STATA 17 installation java.lang.UnsatisfiedLinkError

    I recently upgraded to STATA 17 and once I did so (without errors or obvious problems) then I was no longer able to able to Import text data (delimited csv). When I do (either in code or using GUI) I get the following error:

    Code:
    java.lang.UnsatisfiedLinkError: 'java.lang.String com.stata.Resource.getResource(java.lang.String, java.lang.String)'
            at com.stata.Resource.getResource(Native Method)
            at com.stata.Resource.getUIEX(Resource.java:62)
            at com.stata.plugins.imports.StImportDelimitedUI.<clinit>(StImportDelimitedUI.java:156)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at com.stata.Javacall.load(Javacall.java:162)
            at com.stata.Javacall.load(Javacall.java:103)
    Following advice in other posts I tried to "query java" and received this output:

    Code:
        Java settings
          set java_heapmax     4096m
          set java_home        C:\Program Files\Stata17\utilities\java\windows-x64\zulu-jdk17.0.5\
    I then used
    Code:
    update all, force
    Which took some time to download, reinstalled and reset STATA and then it worked without a problem.

    However, the next time I open STATA I get a "please wait while windows configures STATA 17" dialog box with progress bar and cancel button. When completed STATA opens but java error has returned.

    Does anyone have any ideas?
    ​​​​​​​Thanks!

  • #2
    I think the problem might be with your Java installation. The exception is "Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native." You might try uninstalling and reinstalling the Java JVM. Definitely check to make sure you're on the latest version of Java.

    Comment


    • #3
      Thanks for your reply Daniel. I did reinstall latest version of Java (before a posted here and again after your post). I also "java set home default" to the location of the updated java. Unfortunately this did not work.

      There is definitely something on the STATA front because when I do
      Code:
       
       update all, force
      It ALWAYS finds that there are available uploads. When I allow it to upload STATA downloads everything and installs and then importing delimited text works without any problem or error message whatsoever.

      However, when I close STATA and reopen it I get an unavoidable dialog box that updates STATA again and problem returns.

      This is what java settings look like before and after I do the "update all, force" command. They are the same except for heap usage and committed values.

      Code:
      java query
      -----------------------------------------------------------------------------------------------------------------------
          Java settings
            set java_heapmax     4096m
            set java_home        C:\Program Files\Java\jdk-19\
      
          Java system information
            initialized          yes
            heap usage           27m
            heap committed       60m
            runtime vendor       Oracle Corporation
            runtime version      19.0.2+7-44
            system classpath     C:\Program Files\Stata17\utilities\jar\aspose-words-18.11-jdk16.jar;C:\Program Files\Stata17
      > \utilities\jar\libdeps-core.jar;C:\Program Files\Stata17\utilities\jar\libstata-core.jar;C:\Program Files\Stata17\uti
      > lities\jar\sfi-api.jar;
            javacall classpath   C:\Program Files\Stata17\ado\base\jar\libdeps-plugin.jar;C:\Program Files\Stata17\ado\base\j
      > ar\libstata-plugin.jar
            library path         C:\Program Files\Java\jdk-19\bin\server\jvm.dll
      Is [email protected] the next logical step for support?

      Comment


      • #4
        Is [email protected] the next logical step for support?
        Yes I think it is a good idea to go ahead and reach out to tech support.

        Sorry to hear there was not a quick fix. If you haven't already, you might also want to take a moment to confirm that these paths actually lead to the expected binaries. When you reinstalled Stata, did you re-download the installation files? It is possible your msi file was corrupted during the download process, and if you use the same installation file both times, that could be the problem. Another possibility is that you have a corrupted registry. This would be more likely if you have an older computer, or have had several versions of Stata on the same computer.

        It seems to me like you are downloading a (more or less) correctly configured version of Stata with the -update- command, and windows is hammering over that configuration for some reason when you restart Stata. To me, that indicates that windows is detecting some inconsistency in a configuration somewhere and trying to fix it.

        Comment

        Working...
        X