Solved

unset JAVA_HOME via command prompt

Posted on 2014-02-21
7
2,913 Views
Last Modified: 2014-03-13
I accidentally set:

set JAVA_HOME=C:\"top level directory of your java install"  
set CATALINA_HOME=C:\"top level directory of your Tomcat install"  
set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin  

I want to revert this via command prompt. What should i do?

Regards.
0
Comment
Question by:jazzIIIlove
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 39877076
SET JAVA_HOME=''

Open in new window


or (maybe - can't quite remember if that works on Windows)

UNSET JAVA_HOME

Open in new window

0
 
LVL 1

Assisted Solution

by:jairajnaidu
jairajnaidu earned 100 total points
ID: 39877142
SET JAVA_HOME=''
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39877180
unset fails
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 39877543
Thought it probably would ;)
0
 
LVL 29

Assisted Solution

by:serialband
serialband earned 200 total points
ID: 39877996
Setting that in the command prompt only changes it temporarily in the one command prompt window.  If you need to set it for future command prompt windows, you'll need to set it for the system.

Right click on My Computer
Select Properties from the pull down menu
Click on Advanced system settings in the left sidebar
Click on the Advanced tab
Click on the Environment Variables... button

Look for your variables and you can either edit or delete them.


If you have to do this for several systems via scripts, use the reg command to edit these hives.  A reboot may be needed.

User Variables
HKEY_CURRENT_USER\Environment

System Variables
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Assuming they're only user environment variables.
reg query HKCU\Environment
reg delete HKCU\Environment /v JAVA_HOME
reg delete HKCU\Environment /v CATALINA_HOME

Don't just delete the path, without checking that you don't have other paths in there!!
reg query HKCU\Environment /v PATH
if it's just your paths, then delete.
reg delete HKCU\Environment /v PATH
If you have other paths that's needed by other installations, be sure to put them in place.
reg add HKCU\Environment /v PATH /t REG_EXPAND_SZ, data:%PATH%
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39879118
serialband:

Any reference for your source?

Is there a way to backup/restore env. variables?

Regards.
0
 
LVL 29

Assisted Solution

by:serialband
serialband earned 200 total points
ID: 39879331
What reference do you mean?  A link?  I did those from memory and with reg query.  It's been a little while, but I ran those reg commands frequently to configure new systems and set up environment variables.  I've also test setups within a single command prompt and I'm pretty certain they don't stay set on the system when you close them.


To find the reg commands.
reg /?
Most Windows/DOS commands accept /? to list the help, similar to the -h with linux commands.  There's also help COMMAND_NAME for DOS commands, which doesn't happen to work with the Windows reg command.


To export them to a *.reg file and import them back.
reg export /?
reg import /?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question