aspose file tools
The moose likes Java in General and the fly likes Is J2EE installed on user's computer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Java in General
Bookmark "Is J2EE installed on user Watch "Is J2EE installed on user New topic

Is J2EE installed on user's computer

Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9055
Is there an easy way to find out if the user has installed J2EE? Is there some query I can perform, maybe on the user's system properties?

I'd like some code to run only if J2EE has already been installed, otherwise not.

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

Joined: Dec 10, 2001
Posts: 7023
I'm not aware of any bullet proof strategy for such a thing.
If the J2EE_HOME environment variable is set, then on Windows machines, java -DJ2EE_HOME=%J2EE_HOME% Foo should work, and on Linux or Mac machines java -DJ2EE_HOME=$J2EE_HOME Foo should work to then be able to use System.getProperty("J2EE_HOME") in your Foo application.
So, knowing what I know how to do and faced with your problem, I'd probably make scripts (batch for windows, and a shell script for Linux/Mac) that ran the appropriate command from above, have the client execute the correct script for their OS, and then if the J2EE_HOME environment variable were not set, either prompt for the location of the J2EE installation and let the user select that it was not installed, or just assume that it was not properly installed.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Is J2EE installed on user's computer