Friday, January 23, 2015

eclipse - Java version not recognized when JAVA_HOME defined for a particular USERACCOUNT


I have been struck with problem on my development box.
I have JRE6 on my system and NO ADMIN RIGHTS.
Used this command to add user variables
rundll32 sysdm.cpl,EditEnvironmentVariables
I have defined JAVA_HOME under user variables with proper path to my JRE


now when i check through by run>cmd>java-version It says java is not recognized.


When i check the path by command echo %JAVA_HOME% it shows the path of my JRE.And i have tried checking the environment variables using
set >env.txt The defined environment variable is present.


I am not able to investigate why JAVA is not recognized when I check in command prompt through java -version.
Moreover my eclipse kepler does not opens up says there is no JRE or JDK available in C:\eclipse\jre\bin\javaw.x
Copied this file from JRE folder but that also did not helped in solving the issue.


Answer



After a Long Search i have found the solution for the following problem.Hope this will be quick help for others.


If NO ADMIN ACCESS.
Then you can create a USER Variable by hitting this in command prompt.


rundll32 sysdm.cpl,EditEnvironmentVariables
Here you can define your JAVA_HOME variable with the path to your JDK or JRE like C:\Program Files\Java\jre7
But you are still not done,the above JAVA_HOME is of no use unless you define the PATH variable
So define the Path variable for user variables with bin directory like C:\Program Files\Java\jre7\bin
Now this will make the System Variable and User Variable path merge.



Check in command prompt java -version.It will show the version of your JRE/JDK



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...