JFastText: jniFastTextWrapper in java.library.path
ali3assi opened this issue · comments
Tam commented
Hello Sir @vinhkhuc and everybody who can help,
Im trying to install and trun JFastText in linux.
I did:
module load gcc/4.9.1, then module load Java/1.8.0_45, then load Maven/3.3.9
when i run the command:
1- mvn compile, i got:
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java interface for fastText 0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce) @ jfasttext ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jfasttext ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /gs/project/tws-462-aa/JFastText/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jfasttext ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.560 s
[INFO] Finished at: 2017-11-17T11:56:58-05:00
[INFO] Final Memory: 30M/1930M
Then after when i execute the code using the command:
2- [INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java interface for fastText 0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ jfasttext ---
[WARNING]
java.lang.UnsatisfiedLinkError: no jniFastTextWrapper in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:945)
at org.bytedeco.javacpp.Loader.load(Loader.java:750)
at org.bytedeco.javacpp.Loader.load(Loader.java:657)
at com.github.jfasttext.FastTextWrapper.<clinit>(FastTextWrapper.java:10)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:712)
at org.bytedeco.javacpp.Loader.load(Loader.java:657)
at com.github.jfasttext.FastTextWrapper$FastTextApi.<clinit>(FastTextWrapper.java:171)
at com.github.jfasttext.JFastText.<init>(JFastText.java:14)
at com.github.jfasttext.JFastText.main(JFastText.java:201)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.531 s
[INFO] Finished at: 2017-11-17T11:58:07-05:00
[INFO] Final Memory: 26M/1930M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project jfasttext: An exception occured while executing the Java class. no jniFastTextWrapper in java.library.path -> [Help 1]
My question is about: where is my error? what shoud to do to let the code run?
Not that i added to pom.xml file the following:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<mainClass>com.github.jfasttext.JFastText</mainClass>
<!-- <mainClass>de.dwslab.petar.walks.WalkGeneratorRand</mainClass>-->
</configuration>
</plugin>
Just to be able to run the command: mvn exec:java
Zohar commented
I have same problem. Did you find the way to solve it? Please provide me. Thank you so much.