Skip to content
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

Selecting Data from DB with Java on Raspberry-Pi ERROR #97

Open
painpunisher opened this issue Jun 2, 2018 · 1 comment
Open

Selecting Data from DB with Java on Raspberry-Pi ERROR #97

painpunisher opened this issue Jun 2, 2018 · 1 comment

Comments

@painpunisher
Copy link

painpunisher commented Jun 2, 2018

Hello dev's,

im getting this error on my raspberry pi with raspbian on it with a small java app code is below.
But Works fine on windows 10 no problems there.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no leveldbjni in java.library.path, /tmp/libleveldbjni-32-3210388738393244372.so: /tmp/libleveldbjni-32-3210388738393244372.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)] at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182) at org.fusesource.hawtjni.runtime.Library.load(Library.java:140) at org.fusesource.leveldbjni.JniDBFactory.<clinit>(JniDBFactory.java:48) at leveldbtest.Main.main(Main.java:26)
This is the code:

` package leveldbtest;

import java.io.File;
import java.io.IOException;

import org.iq80.leveldb.DB;
import static org.fusesource.leveldbjni.JniDBFactory.asString;
import static org.fusesource.leveldbjni.JniDBFactory.bytes;
import static org.iq80.leveldb.impl.Iq80DBFactory.factory;
import org.iq80.leveldb.Options;

public class Main {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	DB levelDBStore = null;
	Options options = new Options();
	try {
		levelDBStore = factory.open(new File("levelDBStore"),options);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	
	levelDBStore.put(bytes("key"),bytes("value"));
	
	System.out.println(new String(levelDBStore.get(bytes("key"))));
}

}
`
anyone knows the problem?

Thanks very much.

@krez01
Copy link

krez01 commented Oct 22, 2018

The library you are using is compiled on Intel 32 Architecture.
It runs on your Windows PC because it's having Intel Architecture, mostly it will be 64 bit, but you still can run 32-bit programs on it.
Now you are using that library for Rasberry Pi which is made of ARM architecture.
What you can do see if there is arm version available of the library or if you have the source of the library you can compile yourself for arm architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants