user3387219 user3387219 - 3 years ago 87
Java Question

Java path set wrongly

I have installed Java on a new system. Some random path in my C drive is automatically set for my

variable. Whenever I try to run Java, it shows
java.exe not found
in that wrong path!

I'm trying to change the
variable using the
command, but the new path is only getting added along with the old one. I could not run Java on the system.

set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_71\bin

I've tried setting
variable in Windows Environment Variables list also after setting

When I type Java in
, i get:

The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe.

This path is the old unknown automatically set path.

Is there any way to run Java! I'm using windows 8.

Answer Source

if you are using windows system, please create java_home as a variable and set java home path i.e. till C:\Program Files\Java\jdk1.7.0_71, and in path variable do not delete existing just append new with ;%java_home%\bin

this will work

in you case SET is valid till command prompt is open. do the above changes in my computer -> properties -> advanced ->environment variables

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download