Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

unset JAVA_HOME via command prompt

Posted on 2014-02-21
7
Medium Priority
?
4,193 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 800 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 400 total points
ID: 39877142
SET JAVA_HOME=''
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39877180
unset fails
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Assisted Solution

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

Assisted Solution

by:serialband
serialband earned 800 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 31

Assisted Solution

by:serialband
serialband earned 800 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

877 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