Comments (4)
If you don't set the correct environment variables, you'll encounter the following error:
javac com/example/robusta/HelloWorld.java && RUST_BACKTRACE=full java -Djava.library.path=../target/debug com.example.robusta.HelloWorld
Error: LinkageError occurred while loading main class com.example.robusta.HelloWorld
java.lang.UnsupportedClassVersionError: com/example/robusta/HelloWorld has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0
The above install and export commands resolve this issue.
from robusta.
Thanks for the issue!
Yes, javac
and java
should be on your PATH in order to run the examples, I'll add this prerequisite in the README.
I did try to reproduce it the issue docker
by pulling the fedora:rawhide
image, but couldn't:
$ dnf install make cargo git java-latest-openjdk-demo java-latest-openjdk-devel
-- snip --
$ echo $PATH
/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ git clone https://github.com/giovanniberti/robusta.git
-- snip --
$ cd robusta/robusta-example/
$ make java_run
-- snip --
javac com/example/robusta/HelloWorld.java && RUST_BACKTRACE=full java -Djava.library.path=../target/debug com.example.robusta.HelloWorld
[1, 2, 3, 4]
3
3
The second message you posted makes me suspect that you had a Java 11 installation (which the java
command pointed to) alongside the Java 16 installation you just installed (from which javac
was invoked), thus causing a UnsupportedClassVersionError
.
Could you perhaps investigate whether that's the case?
from robusta.
from robusta.
Understood. I added a section in the README about running the example (7e989e0), I hope that will be enough!
Thank you for taking the time to open an issue about it
from robusta.
Related Issues (11)
- Apparent error in string conversion HOT 10
- Add round-trip test cases for all types that implement `(Try)FromJavaValue` and `(Try)IntoJavaValue`
- Exit code 11 (segfault?) when converting a java class to a JObject HOT 3
- Support for Option<T>? HOT 8
- Refactor `Field` type to have class path and field name as const parameters
- Release HOT 3
- "missing `#[package]` attribute" when deriving TryFromJavaValue but not Signature HOT 11
- codegen for calling methods that take/return `Ljava/lang/Object;`?
- Why is SIG_TYPE for `()` set to "Ljava/lang/Object;"? HOT 2
- Change result type for exceptions from `::robusta_jni::jni::errors::Result<T>` to `Result<T, E>`
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 robusta.