Exception in thread main linux

Exception in thread «main» java.lang.UnsatisfiedLinkError: Cannot find TensorFlow native library for OS: linux, architecture: x86_64

I am trying setup TensorFlow Java application in Eclipse Oxygen (OS: Ubuntu Linux 16.x). I installed Tensorflow and followed the process mentioned in official documentation for Java (Maven Project) installation. I downloaded libtensorflow-1.3.0.jar, jni files and included in the build path. When I execute the program I get this following error

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot find TensorFlow native library for OS: linux, architecture: x86_64. See https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java/README.md for possible solutions (such as building the library from source). Additional information on attempts to find the native library can be obtained by adding org.tensorflow.NativeLibrary.DEBUG=1 to the system properties of the JVM. at org.tensorflow.NativeLibrary.load(NativeLibrary.java:66) at org.tensorflow.TensorFlow.init(TensorFlow.java:36) at org.tensorflow.TensorFlow.(TensorFlow.java:40) at com.tensorflow.malwaredetection.App.main(App.java:13) 
package com.tensorflow.malwaredetection; import org.tensorflow.TensorFlow; /** * Hello world! * */ public class App < public static void main( String[] args ) < System.out.println( "Hello World!"+ TensorFlow.version() ); >> 
 4.0.0 TensorFlow MalwareDetection 0.0.1-SNAPSHOT jar MalwareDetection http://maven.apache.org UTF-8 App  1.8 1.8   junit junit 3.8.1 test  org.tensorflow libtensorflow 1.3.0    

I got tired of this error and tried to do this in an old-fashioned way. Created App.java in a separate folder and included jar, jni files in the same directory. When I execute this from command line, I get different error

dev@ubuntu:~/Downloads$ javac -cp libtensorflow-1.3.0.jar Test1.java dev@ubuntu:~/Downloads$ java -cp libtensorflow-1.3.0.jar:. -Djava.library.path=./jni Test1 Error: Could not find or load main class Test1 dev@ubuntu:~/Downloads$ 

Источник

Читайте также:  Linux setting user group

Exception in thread «main» java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName

I know there have been many posts regarding this exception, but I am not able to fix this issue. Classpath has to be edited I think to resolve it. I am trying to run a program called DistMap in hadoop infrastructure. This is the error I am getting.

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit. Error could not create input directory /distmap_output_input folder on hdfs file system 
cat ~/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH 

Update: $HADOOP_HOME /usr/lib/hadoop $HADOOP_CLASSPATH /usr/lib/hadoop-0.20-mapreduce/hadoop-ant-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop‌​-0.20-mapreduce/hadoop-ant.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples-2.0‌​.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples.jar:/usr/lib/h‌​adoop-0.20-mapreduce/hadoop-core.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-core-2‌​.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test-2.0.0-mr1-cdh4.4‌​.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-tools-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hado‌​op-0.20-mapreduce/hadoop-tools.jar:/usr/lib/hadoop-0.20-mapreduce/lib/*jar:/usr/lib/hadoop/hadoop-common.jar:/usr/lib/hadoop/hadoop-common-2.0.0-cdh4.4.0.jar The last 2 jar files have those classes PlatformName and FsShell. Still its not working. Can anyone please help me fix this issue? Thanks

Источник

Exception in thread «main» java.lang.NoSuchFieldError: LINUX

«C:\Program Files\Java\jdk-13.0.1\bin\java.exe» «-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\lib\idea_rt.jar=59685:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\bin» -Dfile.encoding=UTF-8 -classpath «C:\Users\Asus\Maven wokspace\target\classes;C:\Users\Asus.m2\repository\org\apache\poi\poi\3.12\poi-3.12.jar;C:\Users\Asus.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\Asus.m2\repository\org\apache\poi\poi-ooxml\3.12\poi-ooxml-3.12.jar;C:\Users\Asus.m2\repository\org\apache\poi\poi-ooxml-schemas\3.12\poi-ooxml-schemas-3.12.jar;C:\Users\Asus.m2\repository\org\apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar;C:\Users\Asus.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\Asus.m2\repository\org\seleniumhq\webdriver\webdriver-common\0.9.7376\webdriver-common-0.9.7376.jar;C:\Users\Asus.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\Asus.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\Asus.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\Asus.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\Asus.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\Asus.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\Asus.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\Asus.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\Asus.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\Asus.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\Asus.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\Asus.m2\repository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;C:\Users\Asus.m2\repository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;C:\Users\Asus.m2\repository\org\testng\testng\7.1.0\testng-7.1.0.jar;C:\Users\Asus.m2\repository\com\beust\jcommander\1.72\jcommander-1.72.jar;C:\Users\Asus.m2\repository\com\google\inject\guice\4.1.0\guice-4.1.0-no_aop.jar;C:\Users\Asus.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\Asus.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\Asus.m2\repository\org\yaml\snakeyaml\1.21\snakeyaml-1.21.jar» org.example.Sample Exception in thread «main» java.lang.NoSuchFieldError: LINUX at org.openqa.selenium.net.PortProber.(PortProber.java:43) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:351) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at org.example.Sample.main(Sample.java:8) Process finished with exit code 1

Источник

Читайте также:  Скрин экрана линукс минт

Glassfish5 Error: Exception in thread «main» java.lang.NullPointerException

I have installed glassfish 5 in ubuntu and put it under the directory /opt , but when I typed asadmin start-domain I face this error:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.glassfish.hk2.api.DynamicConfigurationService.createDynamicConfiguration()" because "dcs" is null at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224) at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88) at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217) at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255) at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231) at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371) at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306) at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57) 

Источник

Оцените статью
Adblock
detector