Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I coded for motion detection code in java using javacv ,it is perfectly running on windows but in Ubuntu 13.04 it shows error like this please suggest solutions for this, i'm attaching code also.
Java
sx=158sy=37w=350h=350op7
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/javacpp94368173067/libjniopencv_core.so: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
	at java.lang.Runtime.load0(Runtime.java:795)
	at java.lang.System.load(System.java:1061)
	at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
	at com.googlecode.javacpp.Loader.load(Loader.java:489)
	at com.googlecode.javacpp.Loader.load(Loader.java:431)
	at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at com.googlecode.javacpp.Loader.load(Loader.java:453)
	at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:97)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at com.googlecode.javacpp.Loader.load(Loader.java:453)
	at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
	at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:174)
	at demo1.Demo1.main(Demo1.java:187)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_core in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1878)
	at java.lang.Runtime.loadLibrary0(Runtime.java:849)
	at java.lang.System.loadLibrary(System.java:1087)
	at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
	at com.googlecode.javacpp.Loader.load(Loader.java:481)
	... 12 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
Posted
v2
Comments
[no name] 1-Aug-13 6:56am    
/* * To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package demo1;

/**
*
* @author Admin
*/
import com.googlecode.javacpp.Loader;
import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_calib3d.*;
import static com.googlecode.javacv.cpp.opencv_objdetect.*;
import static demo1.Demo1.setValue;
import static java.awt.BorderLayout.AFTER_LINE_ENDS;
import java.awt.Button;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Label;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.color.ColorSpace;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.image.BufferedImage;
import java.awt.image.ColorConvertOp;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

/**
*
* @author Admin
*/
public class Demo1 extends JFrame implements MouseListener, MouseMotionListener, ActionListener, KeyListener {

static int count[] = new int[100000];
static Frame f;
static ImagePanel ip;
static Image im;
static int drag_status = 0, c1, c2, c3, c4, width, height;
static int cc1, cc2, hh, cct1, cct2, cct11, cct22;
private boolean dragging = false;
static int startx, starty, wi, he, outputpos;
static JButton saverec = new JButton("Save Rectangle");
static JButton plus = new JButton("+");
static JButton minus = new JButton("-");
static File seting = new File("settings.xml");
static int k, oo, k1, k2, k3;
static boolean sflag = false;
static JPanel jp1 = new JPanel();
static JPanel jp2 = new JPanel();
static JPanel jp3 = new JPanel();
static JPanel jp4 = new JPanel();
static JPanel jp5 = new JPanel();
static Label l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12;
static JRadioButton pang, cang, pht, cht, up, down, right, left, crrotate, pavrotate, girdlerotate;
static ButtonGroup pgrp = new ButtonGroup(), cgrp = new ButtonGroup(), argrp = new ButtonGroup();
static ButtonGroup rgrp = new ButtonGroup();
static JTextField df = new JTextField(), paf = new JTextField(), caf = new JTextField(), phf = new JTextField(), chf = new JTextField(), tf = new JTextField(), gf = new JTextField(), thf = new JTextField(), rf = new JTextField();
static JButton crsmv = new JButton("Rotate Right");
static JButton crsmv1 = new JButton("Rotate Left");
static JButton get = new JButton("GET");
static boolean getflag = false;
static boolean calcflag = false;
static boolean rlfl = false;
static Point center_pt, p;
static int ratio;
static double diam;
static double pav_ang;
static double pav_ht;
static double cr_ang;
static double cr_ht;
static double table;
static double girdle;
Richard MacCutchan 1-Aug-13 9:16am    
The message clearly tells you which component is missing from your system.
[no name] 2-Aug-13 5:12am    
so where can i find this *.so file?
Richard MacCutchan 2-Aug-13 5:19am    
If it is not part of the standard java libraries then you need to go to the person/organisation that provides the package you want to use.

1 solution

The error you are encountering is not a result of your Java Code. The consequence is as a result of a missing linux library: libjniopencv_core.so which is contained in another library libopencv_core.so.2.4. You should check with your java library providers to get the linux library, or search the linux repository and download the library. Once you have the library, you need to install it in your system, and make it available in linux libraries.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900