Discussion Locked

Accessing Windows System properties.

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

is there any way to access the system environment properties besides the subset what java supports. Say "userdomain"

Regards,
Pounraj S.,

5 replies

by jay eckles

One way you might do this is to write a COM object that provides access to environment variables, then provide the COM object in a Java wrapper like J-Integra (I think that's the name of the software). Then your Java app can instatiate the Java wrapped COM object, call its methods, and get access to the environment variables.

I think that basically anything you come up with will break the platform independence. If that's not important to you, and you're really just developing for Windows, you might look at Visual J++ or use a Windows-specific language instead of Java, like Visual C++ or Visual Basic.

I love Java, but you have to use the right tool for the right job...

Jay Eckles
www.jayeckles.com

by bayard-generationjava

Standard solution for this kind of problem is to pass it in when the Java application is run.

Something like:

java -Duserdomain=%userdomain% com.generationjava.WindowsApp

This discussion is closed to new replies.