Java Glossary : environment

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : E words : environment.

environment
Different operating systems use different methods of storing parameter and configuring data for programs. This list of parameters, usually including PATH and CLASSPATH, is called the set environment.

Windows Environment

Windows uses a region called the SET ENVIRONMENT where you can place configuring information for programs. It needs to be a decently large size to work with complex programs. If you get out of environment messages you must modify your C:\config.sys file. Look for a line in it like this:

If you find it, make it look exactly like that. If don't see it, add it. You will need to use a text editor such as NOTEPAD to make the change. The /e:17374 specifies the desired size of the set environment in bytes. Make sure there exists a file called: c:\windows\command.com. If not look for one in c:\ and copy it over.

Here is how to set up your config.sys if you use 4DOS.

NT Environment

With NT, you don't need to do this since the environment automatically expands as needed. Further, there is no config.sys or autoexec.bat file in NT.

You can export the NT/W2K/XP set parameters from the registry two ways that don't require JNI:


view

Environment Accessing Kludges

Because some platforms such as the Mac don't have a SET environment, Java does not support access to it. There are several kludges to query it.

  1. Use JNI JNI to poke or peek at the environment in a platform specific way. Remember than some platforms, e.g. Apple Mac don't have an environment. You would have to simulate it with a file.
  2. exec set xxx and echo %xxx% commands. Beware, all changes to the SET environment are lost as soon as your child task exits.
  3. Use JConfig.
  4. Use properties.
  5. use the java.exe -d%flavour% gambit to transfer data from the set environment to a Java property.
  6. Echo the results of set to a env.txt file before your program starts, or in an exec.


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 7119.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/environment.html J:\mindprod\jgloss\environment.html