Code Monkey home page Code Monkey logo

Comments (4)

omac777 avatar omac777 commented on May 28, 2024

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.

giovanniberti avatar giovanniberti commented on May 28, 2024

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.

omac777 avatar omac777 commented on May 28, 2024

from robusta.

giovanniberti avatar giovanniberti commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.