diff options
author | Jiri Vanek <[email protected]> | 2013-04-04 11:20:09 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-04-04 11:20:09 +0200 |
commit | 631606031378c1211a45743b427b7ccce84e7cc0 (patch) | |
tree | 628694814267af3550ecc1676f13dc33c453b916 /plugin/icedteanp/IcedTeaNPPlugin.cc | |
parent | 328f56a9054cf4da46d267825ca175f710fb53a4 (diff) |
Plugin is now honoring the custom jre
Diffstat (limited to 'plugin/icedteanp/IcedTeaNPPlugin.cc')
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 22765c3..bf37b4e 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -48,6 +48,9 @@ exception statement from your version. */ #include <sys/types.h> #include <unistd.h> +//IcedTea-plugin includes +#include "IcedTeaPluginUtils.h" +#include "IcedTeaParseProperties.h" // Liveconnect extension #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaNPPlugin.h" @@ -74,6 +77,7 @@ exception statement from your version. */ #include <nsServiceManagerUtils.h> #endif + // Error reporting macros. #define PLUGIN_ERROR(message) \ g_printerr ("%s:%d: thread %p: Error: %s\n", __FILE__, __LINE__, \ @@ -287,13 +291,29 @@ g_strcmp0(char *str1, char *str2) #endif static std::string get_plugin_executable(){ - return std::string (appletviewer_default_executable); - + std::string custom_jre; + bool custom_jre_defined = find_custom_jre(custom_jre); + if (custom_jre_defined) { + if (IcedTeaPluginUtilities::file_exists(custom_jre+"/bin/java")){ + return custom_jre+"/bin/java"; + } else { + fprintf(stderr, "Your custom jre (/bin/java check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); + } + } + return appletviewer_default_executable; } static std::string get_plugin_rt_jar(){ - return std::string (appletviewer_default_rtjar); - + std::string custom_jre; + bool custom_jre_defined = find_custom_jre(custom_jre); + if (custom_jre_defined) { + if (IcedTeaPluginUtilities::file_exists(custom_jre+"/lib/rt.jar")){ + return custom_jre+"/lib/rt.jar"; + } else { + fprintf(stderr, "Your custom jre (/lib/rt.jar check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); + } + } + return appletviewer_default_rtjar; } |