neural network - JNA class not Found Error using FANNJ for Ubuntu in Eclipse -


i'm trying use fannj in eclipse (on ubuntu), trying create toy program keeps giving error shown below.

code:

package mypackage;  import com.googlecode.fannj.fann;  public class mainclass {    public static void man(string[] args) {       system.out.println("1");       fann fann = new fann("/home/sahil/desktop/intern/java/eclipse/workspace/usingfann/ann_net_output1.net");    } } 

error:

exception in thread "main" java.lang.noclassdeffounderror: com/sun/jna/platform     @ com.googlecode.fannj.fann.<clinit>(fann.java:51)     @ mypackage.mainclass.main(mainclass.java:9)     caused by: java.lang.classnotfoundexception: com.sun.jna.platform     @ java.net.urlclassloader$1.run(urlclassloader.java:366)     @ java.net.urlclassloader$1.run(urlclassloader.java:355)     @ java.security.accesscontroller.doprivileged(native method)     @ java.net.urlclassloader.findclass(urlclassloader.java:354)     @ java.lang.classloader.loadclass(classloader.java:425)     @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308)     @ java.lang.classloader.loadclass(classloader.java:358) 

could works fannj on ubuntu please explain why error comes up?

you have download missing library "jna". after must point in eclipse (using properties of project > java build path > libraries, , adding jar (you can browse on "add external jars...").

a way dependancies project "maven". can create "pom.xml" file on root folder of project. write down:

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelversion>4.0.0</modelversion>     <groupid>com.something</groupid>     <artifactid>myproject</artifactid>     <version>0.0.1-snapshot</version>     <name>myproject</name>     <description>myproject</description>     <dependencies>         <dependency>             <groupid>org.apache.commons</groupid>             <artifactid>commons-lang3</artifactid>             <version>3.3.2</version>         </dependency>         <!-- https://mvnrepository.com/artifact/com.googlecode.fannj/fannj -->         <dependency>             <groupid>com.googlecode.fannj</groupid>             <artifactid>fannj</artifactid>             <version>0.6</version>         </dependency>     </dependencies> </project> 

and finally, on commmand line type # mvn install, download dependancies , default put libraries in "homefolder/.m2". so, browse jna library, gonna find in folder this: "~/.m2/repository/net/java/dev/jna/jna/3.2.7". if project uses other libraries besides fannj, can add in pom file together.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -