Solved

unset JAVA_HOME via command prompt

Posted on 2014-02-21
7
2,529 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
Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

 
LVL 86

Assisted Solution

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

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 27

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now