Skip to content

Commit 3c9c1fa

Browse files
committed
Fix JNI path to work with old and new location, bump to 1.0.18.
1 parent 89d66aa commit 3c9c1fa

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

argparser.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "argparser.h"
1313
#include "argnames.h"
1414
#include "version.h"
15+
#include "sys/stat.h"
1516

1617
#ifndef WIN32
1718
#include <sys/types.h>
@@ -394,14 +395,31 @@ void ArgParser::prepareOptions() {
394395
javaOptions.push_back(option);
395396

396397
option = OPT_JFFI_PATH;
398+
399+
string jniDir;
400+
#ifdef WIN32
401+
string newJniDir = platformDir + "\\lib\\jni";
402+
string oldJniDir = platformDir + "\\lib\\native";
403+
#else
404+
string newJniDir = platformDir + "/lib/jni";
405+
string oldJniDir = platformDir + "/lib/native";
406+
#endif
407+
408+
struct stat jniDirStat;
409+
if (stat(newJniDir.c_str(), &jniDirStat) == 0) {
410+
jniDir = newJniDir;
411+
} else {
412+
jniDir = oldJniDir;
413+
}
414+
397415
#ifdef WIN32
398-
option += (platformDir + "\\lib\\jni;"
399-
+ platformDir + "\\lib\\jni\\i386-Windows;"
400-
+ platformDir + "\\lib\\jni\\x86_64-Windows");
416+
option += (jniDir + ";"
417+
+ jniDir + "\\i386-Windows;"
418+
+ jniDir + "\\x86_64-Windows");
401419
#else
402420
struct utsname name;
403421
if (uname(&name) == 0) {
404-
string ffiBase(platformDir + "/lib/jni");
422+
string ffiBase(jniDir);
405423
string ffiPath = ffiBase;
406424
DIR* dir = opendir(ffiBase.c_str());
407425
struct dirent* ent;

lib/jruby-launcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JRubyLauncher
2-
VERSION = "1.0.18.pre1"
2+
VERSION = "1.0.18"
33
end

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
#ifndef _VERSION_H_
77
#define _VERSION_H_
88

9-
#define JRUBY_LAUNCHER_VERSION "1.0.18.pre1"
9+
#define JRUBY_LAUNCHER_VERSION "1.0.18"
1010

1111
#endif // ! _VERSION_H_

0 commit comments

Comments
 (0)