Closed magreenblatt closed 4 years ago
Original comment by Markus Sosnowski (Bitbucket: syncall, GitHub: syncall).
I found this project: https://github.com/gpakosz/whereami It does exactly the job of findinge the library location (tested on windows / mac). It might be worth using even for normal java (not javaws).
I've used the following code:
#!c++
int dirname_length;
int length = wai_getModulePath(NULL, 0, &dirname_length);
char* path = (char*)malloc(length + 1);
wai_getModulePath(path, length, &dirname_length);
path[length] = '\0';
jstring re = env->NewStringUTF(path);
free(path);
return re
Please create a PR with your proposed changes. Instructions are at https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit.md#markdown-header-creating-a-pull-request
Seems like this would be addressed by issue #317 or issue #367. If something is still missing please comment.
Original report by Markus Sosnowski (Bitbucket: syncall, GitHub: syncall).
My application is distributed through Java Web Start (javaws). Locally everything works perfect, just after launching it through javaws it will not work anymore. You all are doing a great job here, I really hope I can use your work (without nasty hacks). This should not be a great deal, I am just not a C++ programmer or I would do it myself.
Problem:
Javaws loads Native librarys from a remote jar (Just all native stuff zipped together). It does that by extracting the jar into a cache. This cache directory is kind a added to the java.library.path, so loading the nativelib in java works fine. The problem is, the direcotry is NOT added to the java.library.path property. JavaCEF now reads the property with java Code and passes it to the DLL. While the DLL is found, the DLL can not find the additional stuff like locales, jcef_helper.exe etc.
Solution (I think will work):
If no path is specified look relative to the DLL for all the required resources.
If relaitve paths are not so easy with C++ than they are with Java the current direcotry can be looked up with the following (For windows):
Reproduction
To reproduice the Problem:
<?xml version="1.0" encoding="UTF-8"?>