Solved

unset JAVA_HOME via command prompt

Posted on 2014-02-21
7
3,558 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 86

Assisted Solution

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

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 30

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

635 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