-1

I've had a problem with my Java installations for quite some time and I've never had time to sit and try to fix this problem.

So I went ahead and uninstalled all the various versions of Java I'd installed to get Weka to work.

  1. I then went ahead and installed JDK v7u71 x64 (my machine is a 64bit one).

  2. I added the bin directory of this newly installed java to my PATH.

  3. I go to the command prompt and type in 'java -version'. Here, I'm greeted by the same old error messages:

"Error: loading: C:\Windows\jre\bin\msvcr100.dll

Error: loading: C:\Windows\jre\bin\client\jvm.dll"

  1. Then I ran this command: '"C:\Program Files\Java\jre7\bin\java" -version' and the correct version comes up.

I went and looked at the jre directory within the Windows directory and it had an msvcr100.dll there and a jvm.dll. Why is that particular 'java' not working? and what do I have to do to get java to work correctly on my system?

One solution was that I renamed (removed) the Windows jre folder and tried the 'java -version' command. It worked. But I'm not sure that's the best solution to my problem.

1
  • after you change the PATH, type PATH<ENTER> to see the new path that the command prompt sees. If you change the path in windows GUI then you need to open a new cmd prompt to see that changed path in action in that command prompt. If you change the path variable within a command prompt then it'll only be true for that command prompt. Ultimately, run PATH<ENTER> to see the path. IF you enter JAVA and it runs the one in your windows\jre directory then that windows\jre directory is in your PATH. So try opening a new command prompt / changing your path properly.
    – barlop
    Dec 6, 2014 at 17:25

1 Answer 1

0

The correct solution would have been to edit your PATH environment variable, such that is does contain C:\Program Files\Java\jre7\bin but not C:\Windows\jre\bin.

You said you added the new one, but probably you did not delete the old path.

5
  • I added the new one after checking if the PATH had the old one. It wasn't there. Still gave me problems. I checked again. Dec 6, 2014 at 16:52
  • Sorry, so this is not the answer in your case. But did you search your files for another version of java.exe ? Dec 6, 2014 at 16:56
  • There are no other JRE folders on my system. There's a java.exe in the jdk folder in Program Files/Java/jdk<ver> as well, but I don't think that's causing problems. Dec 6, 2014 at 16:59
  • @SiddharthKumar run PATH<ENTER> to see your path. You might be OK deleting that windows\jre java though perhaps it'd have been better to look into reinstalling the jre that is there but many people don't want the java jre there on their system or if it's there they disable java in their browsers.. cos java appets are apparently not very secure
    – barlop
    Dec 6, 2014 at 17:26
  • So you're saying it's fine to get rid of the JRE that's there in the windows directory, right? Dec 6, 2014 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .