This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes autoexec.bat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "autoexec.bat" Watch "autoexec.bat" New topic


fahim chowdhury

Joined: Jul 14, 2002
Posts: 9
I am trying to configure Tomcat on my desktop (operating system: Windows ME) which requires me to put the following line in autoexec.bat:
set JAVA_HOME=C:\JDK1.3_01
When I open autoexec.bat it does not allow me to add any lines. The alert box I get reads:
This MS-DOS program has terminated.
Also, the title bar of the DOS window reads: "FINISHED- AUTOEXEC".
How may I solve this problem?
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
Open up System from the Control Panel. Select the Advanced tab. Add JAVA_HOME as a new system variable.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I'm guessing that you are trying to open the autoexec.bat file for editing by double-clicking on it - which actually attempts to run the batch file and not edit it.
To edit it, the easiest way is probably to browse to the root of the C drive (or to where the autoexec.bat file is), right mouse click on the file and select edit. This opens the file in Notepad for editing. Then just type away and close and save the file.
You could similarly drag and drop the file into any Notepad window in order to edit it.
I prefer to control environment variables as Chad has suggested and my autoexec.bat file is actually just blank.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
fahim chowdhury

Joined: Jul 14, 2002
Posts: 9
Thanks for your help, much appreciated...
One thing though. On Windows ME, I'm pretty sure you can't set environment variables via Control Panel-->System-->Advanced tab (if I recall, that works on Windows NT). There is no advanced tab in the System window in Windows ME. However, if you do Start Menu-->Accessories-->System Tools-->System Information, and then, from THAT page, you select from the menu bar Tools-->System Configuration Utility and hit the Environment tab, that seems to get you where you wanna be in terms of setting environment variables.
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Or --
You can click on the Start button, Run..., type "sysedit" (without the quote marks) to edit autoexec.bat

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
I like to keep shortcuts to a few useful programs like Notepad in C:\WINDOWS\SendTo\, so I can just right-click any file type and Send To->(Insert Your Favorite Text Editor Here).
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
I'm sure you're correct. I'm using Windows2k and I was guessing the ME edition would work the same, but then again, we are talking about Microsoft. :roll:
Anyway, I think it is easier to manage environment variables this way.
I agree. Here's the link:
subject: autoexec.bat
It's not a secret anymore!