This discussion is archived
7 Replies Latest reply: Jul 3, 2013 1:41 AM by gimbal2 RSS

Can't get java Xxxx to run

993288 Newbie
Currently Being Moderated

Odd question.

 

I have done this numerous times before, but on this machine, I can not get this to work. I have added the correct path to my environment variables, this is in Windows 8.

 

If I go to my working directory, and type javac Xxxx.java it runs and is compiles. If I type java Xxxx it says Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries

 

If I go to my java\jdk1.7.0_21\bin directory, I can java and javac those files. java.exe does exist where I expect it to be.

 

I have uninstalled and reinstalled. I have tried uninstalling and reinstalling into a new directory. I have tried everything I could think of. Every time I have retried setting environmental variables, I started with a new dos shell so that it could get any environment updates.

 

I have tried going to my working directory and typing set path=%path%;c:\java\jdk1.7.0_21\bin

 

The machine takes it (and that is my current install path), again I can still javac but not java the program.

 

I can not figure this out for the life of me. Any help would be appreciated (for what its worth, I don't have this problem on my home machine, which is an almost identical).

 

Any help is appreciated.

 

***Edit - Forgot to mention that I am not using an IDE.

  • 1. Re: Can't get java Xxxx to run
    gimbal2 Guru
    Currently Being Moderated

    Seems like you have a broken installation since some DLL cannot be found. Can you invoke java -version or does that also fail?

  • 2. Re: Can't get java Xxxx to run
    993288 Newbie
    Currently Being Moderated

    Fails.

     

    I think I'm on my third removal and install.

  • 3. Re: Can't get java Xxxx to run
    rp0428 Guru
    Currently Being Moderated

    I have done this numerous times before, but on this machine, I can not get this to work. I have added the correct path to my environment variables, this is in Windows 8.

     

    If I go to my working directory, and type javac Xxxx.java it runs and is compiles. If I type java Xxxx it says Error occurred during initialization of VM Unable to load native library: Can't find dependent libraries

     

    If I go to my java\jdk1.7.0_21\bin directory, I can java and javac those files. java.exe does exist where I expect it to be.

     

    I have uninstalled and reinstalled. I have tried uninstalling and reinstalling into a new directory. I have tried everything I could think of. Every time I have retried setting environmental variables, I started with a new dos shell so that it could get any environment updates.

     

    I have tried going to my working directory and typing set path=%path%;c:\java\jdk1.7.0_21\bin

     

    The machine takes it (and that is my current install path), again I can still javac but not java the program.

     

     

    All indications are that you have an older version of Java in your path.

     

    Adding the 'correct path' to your environments variables isn't going to help if you add the new one to the end like you did

    >

    I have tried going to my working directory and typing set path=%path%;c:\java\jdk1.7.0_21\bin

    >

    Windows starts searching the path from the BEGINNING. Post the results of gimbal's suggestion

    >

    java -version

    >

    And then again AFTER putting the new path at the START of the PATH variable

    >

    set PATH=c:\java\jdk1.7.0_21\bin;%PATH%

    >

  • 4. Re: Can't get java Xxxx to run
    993288 Newbie
    Currently Being Moderated

    This is my whole path (I haven't changed it in regards to your post, this is how it has been):

     

    C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\java\jdk1.7.0_21\bin

     

    I only have one java in my path.

     

    java version "1.7.0_21"

    java(tm) se runtime environment (build 1.7.0_21-b11)

    java hotspot(tm) 64-bit server vm (build 23.21-b01, mixed mode)

     

     

    Thank you for helping.

     

    It can find javac.exe just not java.exe either that or a library it needs.

  • 5. Re: Can't get java Xxxx to run
    rp0428 Guru
    Currently Being Moderated

    Well we have to assume you really don't want help since you continue to refuse advice that you were given by two of us. Java has built-in functionality that will TELL YOU what version was found and is being run. Posting what you 'hope' is being run isn't helpful.

     

    It is also totally useless to try to tell us what error you are getting. You need to SHOW US the EXACT steps you are taking and post a copy of the EXACT execeptions or messages that you get.

     

    Unless you start using the same troubleshooting process that millions of other Java users use you will just have to struggle with the problem on your own.


  • 6. Re: Can't get java Xxxx to run
    993288 Newbie
    Currently Being Moderated

    rp0428 -

     

    I closed it because on the fourth uninstall and install for some reason it worked.

     

    "Well we have to assume you really don't want help since you continue to refuse advice that you were given by two of us. Java has built-in functionality that will TELL YOU what version was found and is being run."

     

    When someone asked me:

    " Can you invoke java -version or does that also fail?"

     

    I answered it fails. (I assumed he meant at anywhere that was not the jdk bin directory)

     

    When it was suggested I had an older version of java in my path, I actually cut and paste my path. I then went to the bin directory, and got the java the version, which I posted:

     

    java version "1.7.0_21"

    java(tm) se runtime environment (build 1.7.0_21-b11)

    java hotspot(tm) 64-bit server vm (build 23.21-b01, mixed mode)

     

    in the same message where I posted the path.

     

    If i didn't do what the people were suggesting, it wasn't from a lack of will, but a lack of understanding.

  • 7. Re: Can't get java Xxxx to run
    gimbal2 Guru
    Currently Being Moderated

    993288 wrote:

     

    rp0428 -

     

    I closed it because on the fourth uninstall and install for some reason it worked.

    Computers have this nasty habit of responding in exactly the same way when you keep doing exactly the same thing. So I can't believe that just "suddenly" it worked, something else changed. But whatever - it works now. Lets hope it stays that way.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points