jruby-launcher 1.1.9-java → 1.1.14-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +5 -5
  2. data/Makefile +3 -0
  3. data/Rakefile +1 -2
  4. data/argparser.cpp +55 -14
  5. data/argparser.h +1 -0
  6. data/extconf.rb +7 -0
  7. data/inc/Makefile-conf.mk +5 -0
  8. data/lib/jruby-launcher.rb +1 -1
  9. data/platformlauncher.cpp +20 -5
  10. data/rb_w32_cmdvector.h +3 -3
  11. data/spec/launcher_spec.rb +23 -0
  12. data/spec/spec_helper.rb +0 -5
  13. data/unixlauncher.cpp +4 -0
  14. data/utilsfuncs.cpp +0 -1
  15. data/utilsfuncswin.cpp +20 -2
  16. data/version.h +1 -1
  17. metadata +7 -82
  18. data/pkg/jruby-launcher-1.1.5-java/extconf.rb +0 -5
  19. data/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb +0 -3
  20. data/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  21. data/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  22. data/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  23. data/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  24. data/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  25. data/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  26. data/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb +0 -258
  27. data/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb +0 -81
  28. data/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  29. data/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  30. data/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  31. data/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  32. data/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  33. data/pkg/jruby-launcher-1.1.7-java/extconf.rb +0 -5
  34. data/pkg/jruby-launcher-1.1.7-java/lib/jruby-launcher.rb +0 -3
  35. data/pkg/jruby-launcher-1.1.7-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  36. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/extconf.rb +0 -5
  37. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb +0 -3
  38. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  39. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  40. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  41. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  42. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  43. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  44. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb +0 -258
  45. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb +0 -81
  46. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  47. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  48. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  49. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  50. data/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  51. data/pkg/jruby-launcher-1.1.7-java/spec/launcher_spec.rb +0 -258
  52. data/pkg/jruby-launcher-1.1.7-java/spec/spec_helper.rb +0 -81
  53. data/pkg/jruby-launcher-1.1.8-java/extconf.rb +0 -5
  54. data/pkg/jruby-launcher-1.1.8-java/lib/jruby-launcher.rb +0 -3
  55. data/pkg/jruby-launcher-1.1.8-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  56. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/extconf.rb +0 -5
  57. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb +0 -3
  58. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  59. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  60. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  61. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  62. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  63. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  64. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb +0 -258
  65. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb +0 -81
  66. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  67. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  68. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  69. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  70. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  71. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/extconf.rb +0 -5
  72. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/lib/jruby-launcher.rb +0 -3
  73. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  74. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/extconf.rb +0 -5
  75. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb +0 -3
  76. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  77. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  78. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  79. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  80. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  81. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  82. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb +0 -258
  83. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb +0 -81
  84. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb +0 -5
  85. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb +0 -3
  86. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb +0 -4
  87. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb +0 -258
  88. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb +0 -81
  89. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/spec/launcher_spec.rb +0 -258
  90. data/pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/spec/spec_helper.rb +0 -81
  91. data/pkg/jruby-launcher-1.1.8-java/spec/launcher_spec.rb +0 -258
  92. data/pkg/jruby-launcher-1.1.8-java/spec/spec_helper.rb +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 4a24cd17a7e856fa27004cd2ecae5be7f6fe133bec57528e9cfcdd287293eb76
4
- data.tar.gz: 7a5c616e66f9423f27ea5ed477c5500960527e84fcccb0c12fe53056959c581b
2
+ SHA1:
3
+ metadata.gz: 987a09dffd62bebfaf7e4fb71e747565a6234d88
4
+ data.tar.gz: b622dd25e2cc949ca752edb0bcb1fa5672a3186a
5
5
  SHA512:
6
- metadata.gz: fc086ec3f19e35e4c70d0a8176230785cefc796032ce32f85dfc6c84e723c721e924fe6fd345a3682164e66430e6eb10f569c55342d124a1f6fd0a6dc22b5ba8
7
- data.tar.gz: 07e802263388bb7395b879beef5883189775296c07b4ab81b0a9191a560d797207ebafadb870316a261ef11f9d4b97179a7f2203f1d7089d7e7463d3f16deb54
6
+ metadata.gz: 67e2e289a6bcebdba185e8b9c7a7fcf0168fd0e149d691b746b5ab31906e5859cb1c93073e17833585685aba1e76c55e5deaa6e4d4bbb5fb631fcb7f54ae225d
7
+ data.tar.gz: 5b1e245cbbb37c2b88925273ac8f8341b3dc11159b45c4299f171697ce3bdeaafe8c23be6885b1288e758d6f79bc9000fa91d7d5a03676551b43951521343395
data/Makefile CHANGED
@@ -1,6 +1,8 @@
1
1
  # These line gets substituted with the actual Config::CONFIG items location by extconf.rb
2
2
  PREFIX = notspecified
3
3
  BINDIR = $(PREFIX)/bin
4
+ JRUBY_VERSION = notspecified
5
+ JRUBY_MODULE = 1
4
6
  INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
5
7
  INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
6
8
  OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
@@ -112,6 +114,7 @@ include $(SUB_IMPLMK)
112
114
 
113
115
  # Pick conf based on OS. for mingw64, must manually override for now.
114
116
  ifeq ($(OS),Windows_NT)
117
+ CC=gcc
115
118
  CONF=mingw
116
119
  else
117
120
  CONF=unix
data/Rakefile CHANGED
@@ -28,12 +28,11 @@ task :gemspec => './lib/jruby-launcher.rb' do
28
28
  s.extensions = ["extconf.rb"]
29
29
  s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*"]
30
30
  s.homepage = %q{http://jruby.org}
31
- s.rubyforge_project = %q{jruby-extras}
32
31
  end
33
32
  end
34
33
 
35
34
  desc "Create gem file"
36
- task :package => [:update_version, :gemspec, :spec] do
35
+ task :package => [:update_version, :gemspec] do
37
36
  Gem::PackageTask.new(@gemspec) do |pkg|
38
37
  end
39
38
  Rake::Task['gem'].invoke
data/argparser.cpp CHANGED
@@ -10,6 +10,7 @@
10
10
  #include <algorithm>
11
11
  #include <unistd.h>
12
12
  #include <limits>
13
+ #include <fstream>
13
14
  #include "utilsfuncs.h"
14
15
  #include "argparser.h"
15
16
  #include "argnames.h"
@@ -247,9 +248,9 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
247
248
  }
248
249
  #endif
249
250
 
251
+
250
252
  // Force OpenJDK-based JVMs to use /dev/urandom for random number generation
251
253
  // See https://github.com/jruby/jruby/issues/4685 among others.
252
- struct stat buffer;
253
254
  if (access("/dev/urandom", R_OK) == 0) {
254
255
  // OpenJDK tries really hard to prevent you from using urandom.
255
256
  // See https://bugs.openjdk.java.net/browse/JDK-6202721
@@ -485,12 +486,46 @@ void ArgParser::prepareOptions() {
485
486
  option += cmdName;
486
487
  javaOptions.push_back(option);
487
488
 
488
- if (useModulePath) {
489
- // When modules are present, use module path
490
- option = OPT_CMDLINE_MODULE_PATH;
491
- option += classPath;
489
+ if (!bootClassPath.empty()) {
490
+ if (useModulePath) {
491
+ #ifdef JRUBY_MODULE
492
+ // When modules are present, use module path for the jruby libs (aka bootClassPath)
493
+ option = OPT_CMDLINE_MODULE_PATH;
494
+ #else
495
+ option = OPT_BOOT_CLASS_PATH;
496
+ #endif
497
+ } else {
498
+ option = OPT_BOOT_CLASS_PATH;
499
+ }
500
+ option += bootClassPath;
492
501
  javaOptions.push_back(option);
493
- } else if (separateProcess) {
502
+ }
503
+
504
+ if (useModulePath) {
505
+ string moduleOptsFile = platformDir + "/bin/.jruby.module_opts";
506
+ if (access(moduleOptsFile.c_str(), R_OK) == 0) {
507
+ logMsg("using @arguments file for Java module options");
508
+ javaOptions.push_back(string("@") + platformDir + "/bin/.jruby.module_opts");
509
+ } else {
510
+ // If .module_opts file is not detected, only add options if JRUBY_MODULE is defined.
511
+ // See extconf.rb for rules on which JRuby versions get JRUBY_MODULE.
512
+ #ifdef JRUBY_MODULE
513
+ logMsg("using hardcoded module options");
514
+ javaOptions.push_back("--add-opens");
515
+ javaOptions.push_back("java.base/java.io=org.jruby.dist");
516
+ javaOptions.push_back("--add-opens");
517
+ javaOptions.push_back("java.base/java.nio.channels=org.jruby.dist");
518
+ javaOptions.push_back("--add-opens");
519
+ javaOptions.push_back("java.base/sun.nio.ch=org.jruby.dist");
520
+ javaOptions.push_back("--add-opens");
521
+ javaOptions.push_back("java.management/sun.management=org.jruby.dist");
522
+ #else
523
+ logMsg("no JRuby module support detected, skipping module flags");
524
+ #endif
525
+ }
526
+ }
527
+
528
+ if (separateProcess) {
494
529
  // When launching a separate process, use '-cp' which expands embedded wildcards
495
530
  javaOptions.push_back(OPT_CMDLINE_CLASS_PATH);
496
531
  javaOptions.push_back(classPath);
@@ -500,12 +535,6 @@ void ArgParser::prepareOptions() {
500
535
  javaOptions.push_back(option);
501
536
  }
502
537
 
503
- if (!bootClassPath.empty()) {
504
- option = OPT_BOOT_CLASS_PATH;
505
- option += bootClassPath;
506
- javaOptions.push_back(option);
507
- }
508
-
509
538
  javaOptions.insert(javaOptions.end(), userOptions.begin(), userOptions.end());
510
539
  }
511
540
 
@@ -529,13 +558,25 @@ void ArgParser::useModulesIfPresent() {
529
558
 
530
559
  if (jdkhome.empty()) {
531
560
  logMsg("Unable to detect JPMS modules as JAVA_HOME is not specified");
532
- } else if (access((jdkhome + "/jmods").c_str(), R_OK) == 0) {
561
+ } else if (access((jdkhome + "/lib/modules").c_str(), R_OK) == 0 ||
562
+ releaseFileHasModules()) {
533
563
  logMsg("JPMS jmods dir detected, using module flags");
534
- noBootClassPath = 1;
535
564
  useModulePath = 1;
536
565
  }
537
566
  }
538
567
 
568
+ bool ArgParser::releaseFileHasModules() {
569
+ string releaseFile = jdkhome + "/release";
570
+ std::string line;
571
+ ifstream in(releaseFile.c_str());
572
+ if (in.is_open()) {
573
+ while (getline(in,line)) {
574
+ if (line.find("MODULES") == 0) return true;
575
+ }
576
+ }
577
+ return false;
578
+ }
579
+
539
580
  void ArgParser::constructBootClassPath() {
540
581
  logMsg("constructBootClassPath()");
541
582
  addedToBootCP.clear();
data/argparser.h CHANGED
@@ -54,6 +54,7 @@ protected:
54
54
  void addOptionsToCommandLine(std::list<std::string> & commandLine);
55
55
  bool endsWith(const std::string &string, const std::string &end);
56
56
  void useModulesIfPresent();
57
+ bool releaseFileHasModules();
57
58
 
58
59
  protected:
59
60
  bool separateProcess;
data/extconf.rb CHANGED
@@ -1,5 +1,12 @@
1
1
  mf = File.read('Makefile')
2
2
  mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{RbConfig::CONFIG['bindir']}")
3
3
  mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(RbConfig::CONFIG['libdir'])}")
4
+ mf = mf.gsub(/^JRUBY_VERSION\s*=.*$/, "JRUBY_VERSION = #{JRUBY_VERSION}")
5
+
6
+ # Launcher will use .module_opts file if present, otherwise hardcoded add-opens for this module.
7
+ # Module options are only supported on JRuby 9.2.1 or higher.
8
+ if JRUBY_VERSION =~ /(^1)|(^9\.[01])|(^9\.2\.0\.0)/
9
+ mf = mf.gsub(/^JRUBY_MODULE\s*=.*1$/, "JRUBY_MODULE =")
10
+ end
4
11
  puts mf
5
12
  File.open('Makefile', 'wb') {|f| f << mf}
data/inc/Makefile-conf.mk CHANGED
@@ -71,3 +71,8 @@ ifneq (,$(findstring SunOS,$(CND_PLATFORM)))
71
71
  CFLAGS += -D__SUNOS__
72
72
  LDLIBSOPTIONS += -lsocket -lnsl
73
73
  endif
74
+
75
+ # define JRUBY_MODULE appropriately for target JRuby
76
+ ifeq (1,$(JRUBY_MODULE))
77
+ CFLAGS += -DJRUBY_MODULE=${JRUBY_MODULE}
78
+ endif
@@ -1,3 +1,3 @@
1
1
  module JRubyLauncher
2
- VERSION = "1.1.9"
2
+ VERSION = "1.1.14"
3
3
  end
data/platformlauncher.cpp CHANGED
@@ -147,14 +147,29 @@ bool PlatformLauncher::start(char* argv[], int argc, DWORD *retCode, const char*
147
147
  suppressConsole = false;
148
148
  } else {
149
149
  if (jdkhome.empty()) {
150
- if (!jvmLauncher.initialize(REQ_JAVA_VERSION)) {
151
- logErr(false, true, "Cannot find Java %s or higher.", REQ_JAVA_VERSION);
152
- return false;
150
+ // attempt to get JDK home from registry
151
+ jvmLauncher.initialize(REQ_JAVA_VERSION);
152
+ }
153
+
154
+ if (!jdkhome.empty()) {
155
+ java = jdkhome + "\\bin\\java.exe";
156
+ } else if (getenv("JAVA_HOME") != NULL) {
157
+ string java_home = string(getenv("JAVA_HOME"));
158
+ jdkhome = java_home;
159
+ java_home = trimTrailingBackslashes(java_home);
160
+ java = java_home + "\\bin\\java.exe";
161
+ } else {
162
+ java = findOnPath("java.exe");
163
+ if (!java.empty()) {
164
+ int home_index = java.find_last_of('\\', java.find_last_of('\\') - 1);
165
+ jdkhome = java.substr(0, home_index);
153
166
  }
154
167
  }
168
+ }
155
169
 
156
- jvmLauncher.getJavaPath(jdkhome);
157
- java = jdkhome + "\\bin\\java";
170
+ if (java.empty()) {
171
+ printToConsole("No `java.exe' executable found on PATH.");
172
+ return 255;
158
173
  }
159
174
 
160
175
  prepareOptions();
data/rb_w32_cmdvector.h CHANGED
@@ -52,7 +52,7 @@ int rb_w32_cmdvector(const char *cmd, char ***vec) {
52
52
  char *ptr, *base, *buffer, *cmdline;
53
53
  char **vptr;
54
54
  char quote;
55
- NtCmdLineElement *curr, **tail;
55
+ NtCmdLineElement *curr;
56
56
  NtCmdLineElement *cmdhead = NULL, **cmdtail = &cmdhead;
57
57
 
58
58
  //
@@ -237,7 +237,7 @@ int rb_w32_cmdvector(const char *cmd, char ***vec) {
237
237
  buffer = (char *)malloc(len);
238
238
  if (!buffer) {
239
239
  do_nothing:
240
- while (curr = cmdhead) {
240
+ while ((curr = cmdhead)) {
241
241
  cmdhead = curr->next;
242
242
  if (curr->flags & NTMALLOC) free(curr->str);
243
243
  free(curr);
@@ -263,7 +263,7 @@ int rb_w32_cmdvector(const char *cmd, char ***vec) {
263
263
 
264
264
  ptr = buffer + (elements+1) * sizeof(char *);
265
265
 
266
- while (curr = cmdhead) {
266
+ while ((curr = cmdhead)) {
267
267
  strlcpy(ptr, curr->str, curr->len + 1);
268
268
  *vptr++ = ptr;
269
269
  ptr += curr->len + 1;
@@ -1,3 +1,4 @@
1
+ require 'tmpdir'
1
2
  require File.expand_path('../spec_helper.rb', __FILE__)
2
3
  load File.expand_path('../../lib/jruby-launcher.rb', __FILE__)
3
4
 
@@ -255,4 +256,26 @@ describe "JRuby native launcher" do
255
256
  it "should not crash on format-strings" do
256
257
  jruby_launcher_args("-e %s%s%s%s%s 2>&1").should include('-e', '%s%s%s%s%s')
257
258
  end
259
+
260
+ it "should use --module-path on java9+ jruby 9.2.1+" do
261
+ # versions prior to 9.2.1 do not set a predictable module name
262
+ skip unless (JRUBY_VERSION.split('.') <=> ['9', '2', '1']) >= 0
263
+
264
+ Dir.mktmpdir do |java_home|
265
+ FileUtils.mkdir_p(File.join(java_home, 'lib/modules'))
266
+ with_environment 'JAVA_HOME' => java_home do
267
+ jruby_launcher_args('').grep(/^--module-path=.*jruby.jar/).should_not be_empty
268
+ end
269
+ end
270
+ end
271
+
272
+ it "should not treat CLASSPATH entries as modules on java9+" do
273
+ Dir.mktmpdir do |java_home|
274
+ Dir.mkdir(File.join(java_home, 'jmods'))
275
+ with_environment 'JAVA_HOME' => java_home, 'CLASSPATH' => '/some/lib.jar' do
276
+ jruby_launcher_args('').grep(/^--module-path=.*\/some\/lib.jar/).should be_empty
277
+ classpath_arg(jruby_launcher_args('')).should =~ /\/some\/lib.jar/
278
+ end
279
+ end
280
+ end
258
281
  end
data/spec/spec_helper.rb CHANGED
@@ -2,11 +2,6 @@ require 'rspec'
2
2
  require 'rbconfig'
3
3
  require 'fileutils'
4
4
 
5
- if defined?(JRUBY_VERSION)
6
- require 'jruby'
7
- JRuby.runtime.instance_config.run_ruby_in_process = false
8
- end
9
-
10
5
  module JRubyLauncherHelper
11
6
  JRUBY_EXE = ''
12
7
  WINDOWS = RbConfig::CONFIG['target_os'] =~ /mswin/
data/unixlauncher.cpp CHANGED
@@ -56,6 +56,10 @@ int UnixLauncher::run(int argc, char* argv[], char* envp[]) {
56
56
  java = java_home + "/bin/java";
57
57
  } else {
58
58
  java = findOnPath("java");
59
+ if (!java.empty()) {
60
+ int home_index = java.find_last_of('/', java.find_last_of('/') - 1);
61
+ jdkhome = java.substr(0, home_index);
62
+ }
59
63
  }
60
64
  }
61
65
 
data/utilsfuncs.cpp CHANGED
@@ -123,7 +123,6 @@ string findOnPath(const char* name) {
123
123
  string path(getenv("PATH"));
124
124
  size_t start = 0;
125
125
  size_t sep;
126
- char * found;
127
126
 
128
127
  while (start < path.length()) {
129
128
  sep = path.find(PATH_SEP, start);
data/utilsfuncswin.cpp CHANGED
@@ -39,10 +39,27 @@ bool disableFolderVirtualization(HANDLE hProcess) {
39
39
  return true;
40
40
  }
41
41
 
42
+ typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
43
+
44
+ LPFN_ISWOW64PROCESS IsWow64Process;
45
+
46
+ BOOL is64bits() {
47
+ BOOL is64Bits = FALSE;
48
+ IsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle(TEXT("kernel32")),"IsWow64Process");
49
+
50
+ if (IsWow64Process && !IsWow64Process(GetCurrentProcess(),&is64Bits)) {}
51
+
52
+ return is64Bits;
53
+ }
54
+
55
+ #define KEY_WOW64_64KEY 0x0100
56
+ #define KEY_WOW64_32KEY 0x0200
57
+
42
58
  bool getStringFromRegistry(HKEY rootKey, const char *keyName, const char *valueName, string &value) {
43
59
  logMsg("getStringFromRegistry()\n\tkeyName: %s\n\tvalueName: %s", keyName, valueName);
60
+ DWORD openFlags = KEY_READ | (is64bits() ? KEY_WOW64_64KEY : KEY_WOW64_32KEY);
44
61
  HKEY hKey = 0;
45
- if (RegOpenKeyEx(rootKey, keyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
62
+ if (RegOpenKeyEx(rootKey, keyName, 0, openFlags, &hKey) == ERROR_SUCCESS) {
46
63
  DWORD valSize = 4096;
47
64
  DWORD type = 0;
48
65
  char val[4096] = "";
@@ -64,8 +81,9 @@ bool getStringFromRegistry(HKEY rootKey, const char *keyName, const char *valueN
64
81
 
65
82
  bool getDwordFromRegistry(HKEY rootKey, const char *keyName, const char *valueName, DWORD &value) {
66
83
  logMsg("getDwordFromRegistry()\n\tkeyName: %s\n\tvalueName: %s", keyName, valueName);
84
+ DWORD openFlags = KEY_READ | (is64bits() ? KEY_WOW64_64KEY : KEY_WOW64_32KEY);
67
85
  HKEY hKey = 0;
68
- if (RegOpenKeyEx(rootKey, keyName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
86
+ if (RegOpenKeyEx(rootKey, keyName, 0, openFlags, &hKey) == ERROR_SUCCESS) {
69
87
  DWORD valSize = sizeof(DWORD);
70
88
  DWORD type = 0;
71
89
  if (RegQueryValueEx(hKey, valueName, 0, &type, (BYTE *) &value, &valSize) == ERROR_SUCCESS
data/version.h CHANGED
@@ -6,6 +6,6 @@
6
6
  #ifndef _VERSION_H_
7
7
  #define _VERSION_H_
8
8
 
9
- #define JRUBY_LAUNCHER_VERSION "1.1.9"
9
+ #define JRUBY_LAUNCHER_VERSION "1.1.14"
10
10
 
11
11
  #endif // ! _VERSION_H_
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.14
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger
8
8
  - Vladimir Sizikov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-27 00:00:00.000000000 Z
12
+ date: 2021-03-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Builds and installs a native launcher for JRuby on your system
15
15
  email:
@@ -39,81 +39,6 @@ files:
39
39
  - lib/rubygems/defaults/jruby_native.rb
40
40
  - nbexecloader.h
41
41
  - ng.c
42
- - pkg/jruby-launcher-1.1.5-java/extconf.rb
43
- - pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb
44
- - pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb
45
- - pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
46
- - pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
47
- - pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
48
- - pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
49
- - pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
50
- - pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb
51
- - pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb
52
- - pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
53
- - pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
54
- - pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
55
- - pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
56
- - pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
57
- - pkg/jruby-launcher-1.1.7-java/extconf.rb
58
- - pkg/jruby-launcher-1.1.7-java/lib/jruby-launcher.rb
59
- - pkg/jruby-launcher-1.1.7-java/lib/rubygems/defaults/jruby_native.rb
60
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/extconf.rb
61
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb
62
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb
63
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
64
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
65
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
66
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
67
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
68
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb
69
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb
70
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
71
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
72
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
73
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
74
- - pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
75
- - pkg/jruby-launcher-1.1.7-java/spec/launcher_spec.rb
76
- - pkg/jruby-launcher-1.1.7-java/spec/spec_helper.rb
77
- - pkg/jruby-launcher-1.1.8-java/extconf.rb
78
- - pkg/jruby-launcher-1.1.8-java/lib/jruby-launcher.rb
79
- - pkg/jruby-launcher-1.1.8-java/lib/rubygems/defaults/jruby_native.rb
80
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/extconf.rb
81
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb
82
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb
83
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
84
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
85
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
86
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
87
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
88
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb
89
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb
90
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
91
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
92
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
93
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
94
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
95
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/extconf.rb
96
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/lib/jruby-launcher.rb
97
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/lib/rubygems/defaults/jruby_native.rb
98
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/extconf.rb
99
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/jruby-launcher.rb
100
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/lib/rubygems/defaults/jruby_native.rb
101
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
102
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
103
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
104
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
105
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
106
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/launcher_spec.rb
107
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5-java/spec/spec_helper.rb
108
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/extconf.rb
109
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/jruby-launcher.rb
110
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/lib/rubygems/defaults/jruby_native.rb
111
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/launcher_spec.rb
112
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/pkg/jruby-launcher-1.1.5.pre-java/spec/spec_helper.rb
113
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/spec/launcher_spec.rb
114
- - pkg/jruby-launcher-1.1.8-java/pkg/jruby-launcher-1.1.7-java/spec/spec_helper.rb
115
- - pkg/jruby-launcher-1.1.8-java/spec/launcher_spec.rb
116
- - pkg/jruby-launcher-1.1.8-java/spec/spec_helper.rb
117
42
  - platformlauncher.cpp
118
43
  - platformlauncher.h
119
44
  - rb_w32_cmdvector.h
@@ -131,7 +56,7 @@ files:
131
56
  homepage: http://jruby.org
132
57
  licenses: []
133
58
  metadata: {}
134
- post_install_message:
59
+ post_install_message:
135
60
  rdoc_options: []
136
61
  require_paths:
137
62
  - lib
@@ -146,9 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
71
  - !ruby/object:Gem::Version
147
72
  version: '0'
148
73
  requirements: []
149
- rubyforge_project: jruby-extras
150
- rubygems_version: 2.7.6
151
- signing_key:
74
+ rubyforge_project:
75
+ rubygems_version: 2.5.2.3
76
+ signing_key:
152
77
  specification_version: 4
153
78
  summary: Native launcher for JRuby
154
79
  test_files: []