-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use java.io.tmpdir instead of user.home for storing extracted library #270
Comments
Well, you can do this pretty easily yourself: String tempDirectory;
try {
tempDirectory = Files.createTempDirectory("J2V8_temp").toString();
} catch (final IOException e) {
// Temp dir creation failed - use J2V8 default
tempDirectory = null;
}
V8.createV8Runtime(null, tempDirectory) This creates a temporary folder "J2V8_temp" inside the systems tmp folder. We recently fell over this, because on Alpine (#252) user.home defaults to "/" - which fails to write to (at least in our Docker context). |
In my case I'm actually using another library which in turn uses j2v8, but even though I can probably workaround it by manually initializing j2v8 first and then only use the other library. |
I agree that default makes sense to tempDir. This is very easy PR you could contribute this @tarioch |
Currently the LibraryLoader uses "user.home" as the fallback, it would be nicer if it would use "java.io.tmpdir" instead.
The text was updated successfully, but these errors were encountered: