Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is J2EE installed on user's computer

 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic