File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Bat file to setup java enviroment. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Bat file to setup java enviroment." Watch "Bat file to setup java enviroment." New topic

Bat file to setup java enviroment.

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
Hey yo,

This is a long story but I have created a .bat file to setup the java enviroment as the global variaables are restricted on the UNI computers, and java isnt set up right. It works fine but I would like to modify it so it can be double clicked upon, and then remain in the command line (elimating the need to open it in a command shell). Just wondering if it is possible (oh and I cant use a c++ script as C++ dosent work either ).

Thanks for any help.
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Ok, I understand what you mean by setting up your environment, but it would be good to be able to see exactly what you're doing in that .bat file to know better whether or not this would help you. Anyway, I *think* this will maintain your environment. I have 2 .bat files on my Desktop:

test.bat, which calls another.bat

another.bat has the following in it:

test.bat has this in it:

On Windows XP, cmd (cmd.exe) is preferable over or whatever the old one was called. The /c is how you pass a parameter to it. Then, in the same environment (I think), I call cmd again to get the prompt back. Try that and can, of course, just replace another.bat with your current .bat file. Here's the output I got from double-clicking test.bat, and it was all in one shell window:

[ November 12, 2004: Message edited by: Stephen Huey ]
Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
Hey yo,

As usally I have made an ass of myself asking a question that Is answered by such a simple command. Thanks for the help, and here is my .bat file

I made this file for the computers at my unveristy, they use an image booting system (deep freeze) and the images have the wrong enviroment settings.

Once again thanks for the help.
subject: Bat file to setup java enviroment.
It's not a secret anymore!