#include #include #include #include using namespace std; #ifdef WINDOWS #include #endif void replace_all( std::string & str, std::string const & pattern, std::string const & replacement ); int process( string command, bool render ); int process_and_catch_output( string command, string &output ); #ifdef WINDOWS int regSearch(HKEY hKey, const char* keyName, int searchType, char* foundJavaVer ); #endif class Jvm { // version string. era.major.minor_update. eg: 1.4.2_02 int era; int major; int minor; int update; string javaHome; bool isJdk; bool healthy; public: Jvm(); void setJavaHome( string jh ); string getJavaHome(); string getExecutable(); #ifdef WINDOWS string getWinExecutable(); #endif string getVersion(); bool check(); bool setVersionFromString( string version ); int compare( Jvm otherJvm ); int getEra(); int getMajor(); int getMinor(); int getUpdate(); private: void setVersionFromExeOuput(); }; bool find( Jvm &jvm, bool use_minimum, Jvm minimum, string phint, string hint, bool verbose );