Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Loading DLL from file not PATH

Loading DLL from file not PATH

Scheduled Pinned Locked Moved C / C++ / MFC
helpjavac++comdebugging
28 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    Valentinor wrote:

    The code execution cannot proceed because jvm.dll was not found.

    I think I have answered that more than once.

    Valentinor wrote:

    They should add an image preview

    This has been rejected a number of times as it would be open to abuse by spammers.

    V Offline
    V Offline
    Valentinor
    wrote on last edited by
    #21

    Richard MacCutchan wrote:

    If the customer correctly installs the Java runtime then it will set the PATH variable with the correct details. Your code should then run correctly. I have done a test on my system and that is all that is needed as far as I can tell.

    You did said this, and I've done it, even on 2 new separate VM's, installed Java and needed redistributable and on both I get the same error.

    L 1 Reply Last reply
    0
    • V Valentinor

      Richard MacCutchan wrote:

      If the customer correctly installs the Java runtime then it will set the PATH variable with the correct details. Your code should then run correctly. I have done a test on my system and that is all that is needed as far as I can tell.

      You did said this, and I've done it, even on 2 new separate VM's, installed Java and needed redistributable and on both I get the same error.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #22

      So you keep saying. But I cannot see what is happening on your system. I have tried multiple tests of this issue with Java versions 1.8, 14 and 17 and cannot recreate the problem you are having.

      V 1 Reply Last reply
      0
      • L Lost User

        So you keep saying. But I cannot see what is happening on your system. I have tried multiple tests of this issue with Java versions 1.8, 14 and 17 and cannot recreate the problem you are having.

        V Offline
        V Offline
        Valentinor
        wrote on last edited by
        #23

        unknown 2022 06 16 11 59 - YouTube[^] Here is a video, first run is on host where I have jdk, Visual Studio..., and second is on VM.

        L 1 Reply Last reply
        0
        • V Valentinor

          unknown 2022 06 16 11 59 - YouTube[^] Here is a video, first run is on host where I have jdk, Visual Studio..., and second is on VM.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #24

          I owe you an apology. I do not have a VM to run this on so my reinstalls of Java were missing something that I had set up in the past. The jvm.dll is not in the bin directory of the JRE installation, but in a subdirectory named server. This was in my PATH variable and was not removed when I uninstalled one of the Java versions. So you need to add that location to the PATH variable manually. Sorry again for the confusion.

          V 1 Reply Last reply
          0
          • L Lost User

            I owe you an apology. I do not have a VM to run this on so my reinstalls of Java were missing something that I had set up in the past. The jvm.dll is not in the bin directory of the JRE installation, but in a subdirectory named server. This was in my PATH variable and was not removed when I uninstalled one of the Java versions. So you need to add that location to the PATH variable manually. Sorry again for the confusion.

            V Offline
            V Offline
            Valentinor
            wrote on last edited by
            #25

            The thing is that when Java is installed it doesn't add some kind of dynamic link in PATH to where jvm.dll is located, well it doesn't add one at all. Yes, if I'm compiling the class with 1.8 and then on VM I can manually add in PATH the server folder, but here is a problem, the user should not go though this process of opening variables and find PATH to add it there. A solution would be that when the app is opened, it would check if Java in installed, if it is not, then the user would be prompted to download it, or I have to search and see if you can legally distribute JavaSetup8uxxx.exe file and if you can the app would automatically run the file and the user would go though the process of installing Java. After Java is installed by either way then the app will search what version is installed to know what location to add in PATH, which it would do after knowing that. At this point the app will run fine. BUT then you run into another problem, if the user updates Java then the location will change for jvm.dll, so you would have to add another variable to PATH with the new location for it, and remove the old one. Adding a variable to PATH shouldn't be a problem, as Java and other programs do it too, I'll just have to see how that is done from C++ code. If this is actually the only way to do it, then I guess I can do it this way, but having another solution that wouldn't involve adding variables to PATH would have been better.

            L 2 Replies Last reply
            0
            • V Valentinor

              The thing is that when Java is installed it doesn't add some kind of dynamic link in PATH to where jvm.dll is located, well it doesn't add one at all. Yes, if I'm compiling the class with 1.8 and then on VM I can manually add in PATH the server folder, but here is a problem, the user should not go though this process of opening variables and find PATH to add it there. A solution would be that when the app is opened, it would check if Java in installed, if it is not, then the user would be prompted to download it, or I have to search and see if you can legally distribute JavaSetup8uxxx.exe file and if you can the app would automatically run the file and the user would go though the process of installing Java. After Java is installed by either way then the app will search what version is installed to know what location to add in PATH, which it would do after knowing that. At this point the app will run fine. BUT then you run into another problem, if the user updates Java then the location will change for jvm.dll, so you would have to add another variable to PATH with the new location for it, and remove the old one. Adding a variable to PATH shouldn't be a problem, as Java and other programs do it too, I'll just have to see how that is done from C++ code. If this is actually the only way to do it, then I guess I can do it this way, but having another solution that wouldn't involve adding variables to PATH would have been better.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #26

              I have tried a couple of ideas, and looked again at the documentation, but I cannot find a simple answer. It would appear that there is no simple method of installing this on a user's system, other than what you have already discovered.

              1 Reply Last reply
              0
              • V Valentinor

                The thing is that when Java is installed it doesn't add some kind of dynamic link in PATH to where jvm.dll is located, well it doesn't add one at all. Yes, if I'm compiling the class with 1.8 and then on VM I can manually add in PATH the server folder, but here is a problem, the user should not go though this process of opening variables and find PATH to add it there. A solution would be that when the app is opened, it would check if Java in installed, if it is not, then the user would be prompted to download it, or I have to search and see if you can legally distribute JavaSetup8uxxx.exe file and if you can the app would automatically run the file and the user would go though the process of installing Java. After Java is installed by either way then the app will search what version is installed to know what location to add in PATH, which it would do after knowing that. At this point the app will run fine. BUT then you run into another problem, if the user updates Java then the location will change for jvm.dll, so you would have to add another variable to PATH with the new location for it, and remove the old one. Adding a variable to PATH shouldn't be a problem, as Java and other programs do it too, I'll just have to see how that is done from C++ code. If this is actually the only way to do it, then I guess I can do it this way, but having another solution that wouldn't involve adding variables to PATH would have been better.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #27

                I have been working on a possible answer to this. If you send me a personal email (see the link below this message) I can let you have the details, and the code. One of the things I have discovered is the the jvm.dll must be the same version as that of the javac compiler that buiolds the class file(s).

                V 1 Reply Last reply
                0
                • L Lost User

                  I have been working on a possible answer to this. If you send me a personal email (see the link below this message) I can let you have the details, and the code. One of the things I have discovered is the the jvm.dll must be the same version as that of the javac compiler that buiolds the class file(s).

                  V Offline
                  V Offline
                  Valentinor
                  wrote on last edited by
                  #28

                  I don't see any link it might have been cut, or it is hidden, but this is an old email I have that I don't care about spam so it is fine to make it public: Email removed

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups