Comments (5)
OK, I reinstalled Rust from its offline installer. After that the program was correctly complaining about jvm.dll not found. Then it complained about not finding jvm.lib when linking. That was fixed by adding a build.rs file with just the following:
fn main(){
if cfg!(target_os = "windows") {
println!(r"cargo:rustc-link-search=c:\Path\to\jdk\lib\");
}
}
So, now I'm getting errors when I execute the binary compiled complaining that the jvm.dll could not be found even though the directory is in Path.
from jni-rs.
The reason is that in Powershell "set PATH" doesn't really have any effect.
Had to export the path as $env:Path = $env:Path + "\path\to\jvm.dll"
from jni-rs.
The error message is wrong: on windows it looks for jvm.dll
(see here).
Have you set JAVA_HOME
? Do you have jvm.dll
somewhere in it?
The build script looks for jvm.dll
in all the subdirectories of the path specified in the JAVA_HOME
environment variable.
from jni-rs.
You should add a directory with jvm.dll into the PATH environment variable.
from jni-rs.
I have specified JAVA_HOME and the jvm.dll is in %JAVA_HOME%\jre\bin\server.
from jni-rs.
Related Issues (20)
- Implement `std::iter::Iter` on arrays? HOT 1
- Create a replacement for `ndk-context` just for sharing a `JavaVM` pointer between modular / orthogonal crates HOT 1
- Is it safe to have multiple versions of the `jni` crate in use within a single application? HOT 1
- Cross compiling for Android HOT 14
- Add Android target[s] to CI
- JNIEnv::get_object_array_element requires &mut self HOT 2
- Example request: `call_method` with non-primitive type as parameters. HOT 4
- TryFrom<char> for `char` primitive HOT 7
- 0.21 mutability requirements on `JNIEnv` methods break use of `catch_unwind` HOT 15
- Nested "critical sections" disallowed by borrow checker HOT 1
- Provide ways to use `CallNonvirtual*Method` in `JNIEnv` HOT 1
- Converting between types in JNI code HOT 2
- `AttachGuard` detaches too soon when dropped out of order HOT 2
- how to use call_static_method_unchecked with a GlobalRef to a class? HOT 2
- how to get java list on rust HOT 1
- CallNonvirtual<type>Method support request HOT 2
- Can i load native function on exec self ? HOT 3
- Question: How I use `GetObjectRefType` HOT 4
- Make methods `const fn` when it makes sense HOT 1
- `get_rust_field()` exclusive access to `JNIEnv` HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jni-rs.