openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
152 stars 81 forks source link

Crash in HLA 1.3 & 1516e C++ interfaces if JAVA_HOME not set #137

Open timpokorny opened 9 years ago

timpokorny commented 9 years ago

Summary

Portico C++ federates will crash if JAVA_HOME environment variable is not set.

In the HLA13 class Runtime.cpp#286 there is the call:

string jrelocation( getenv("JAVA_HOME") );

If JAVA_HOME is not set, this will return null and then there will be a crash. The same code is present in the 1516e interface: Runtime.cpp#240

Throughout these classes there are many other uses of getenv that do not check for null and should also be remediated.

Environment and Logs

timpokorny commented 8 years ago

Verified while trying to test Portico WAN things. JAVA_HOME needs to be set. It doesn't matter what to, it just needs to be set to something.

timpokorny commented 8 years ago

Currently hamstrung by the fact that the federates themselves don't seem to work happily on Mac OS X.