Forum Stats

  • 3,728,148 Users
  • 2,245,557 Discussions
  • 7,853,352 Comments

Discussions

JRE 8 Update 31 on a Windows 8 Machine "Java -version" not working

Whack a Mac
Whack a Mac Member Posts: 1
edited March 2015 in Java 8 Questions

Hi folks

I'm working for a software development company. At the moment we are testing the functionality of Java 8 with our software and the use of Java 8 in our environment. For the installation we use an automatic installation of the .msi file for 32-bit and 64-bit Version of Java 8.

So far, everything is working fine on our test machines with Java 8 Update 31. The only thing we noticed was, that we had a couple of errors when we were checking the java version via console.

For example, when we upgrade a machine from Java 7 to Java 8, we first uninstall Java 7, reboot and then install Java 8. After that whole process we do get an error when we run the command "java -version".

Error: The command "java" was not found or is written incorrect (not exactly that error, cause we have a German version of windows).

This only happens on machines with windows 8

On a windows 7 machine we get the correct output:

C:\>java -version

java version "1.8.0_31"

Java(TM) SE Runtime Environment (build 1.8.0_31-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

We could resolve the issue on a windows 8 machine by adding the installation directory of java in the "path" systemvariable. Once the "C:\Program Files\Java\jre1.8.0_31\bin" is added, the command returns the correct output.

This workaround is not a good option in my opinion, because I don't want to setup some crazy GPO to hard code the installationdir into the systemvariable. I think the installer should handle this task for me.

Did anyone here run into similar issues with java on windows 8 or does anybody know a better way to fix the problem?

Best regards

Daniel

Best Answer

  • Unknown
    edited March 2015 Accepted Answer
    We could resolve the issue on a windows 8 machine by adding the installation directory of java in the "path" systemvariable. Once the "C:\Program Files\Java\jre1.8.0_31\bin" is added, the command returns the correct output.
    This workaround is not a good option in my opinion, because I don't want to setup some crazy GPO to hard code the installationdir into the systemvariable. I think the installer should handle this task for me.
    
    Did anyone here run into similar issues with java on windows 8 or does anybody know a better way to fix the problem?
    

    Your 'workaround' is your solution. The Java installer does NOT modify the path. Any PATH modification must be done by the user.

    Another alternative is to create a simple 'java.bat' file that is in a directory that is on the path.

    That batch file can add the appropriate entry to the PATH environment variable and then launch Java.

    Whack a Mac

Answers

  • Unknown
    edited March 2015 Accepted Answer
    We could resolve the issue on a windows 8 machine by adding the installation directory of java in the "path" systemvariable. Once the "C:\Program Files\Java\jre1.8.0_31\bin" is added, the command returns the correct output.
    This workaround is not a good option in my opinion, because I don't want to setup some crazy GPO to hard code the installationdir into the systemvariable. I think the installer should handle this task for me.
    
    Did anyone here run into similar issues with java on windows 8 or does anybody know a better way to fix the problem?
    

    Your 'workaround' is your solution. The Java installer does NOT modify the path. Any PATH modification must be done by the user.

    Another alternative is to create a simple 'java.bat' file that is in a directory that is on the path.

    That batch file can add the appropriate entry to the PATH environment variable and then launch Java.

    Whack a Mac
Sign In or Register to comment.