how to set java -Djava.library.path=“\home\path.SomeFile.so” in linux environment for Tomcat instance?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 22:22:27

问题


How do i set it in the Linux environment?

I keep getting the below error.
I am assuming its because i have to set the -Djava path . in eclipse i set in the arguments in the run configuration.

java.lang.UnsatisfiedLinkError: /opt/apache-tomcat-8.0.33/temp/librocksdbjni1678787310187961141..so: libgflags.so.2: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLi

回答1:


You need to set the JVM parameter in [path to tomcat]/bin/catalina.sh, in the variable CATALINA_OPTS or JAVA_OPTS.

The value should be a valid Linux path (or paths) containing your libraries.

You can refer to this question: add jvm options in tomcat



来源:https://stackoverflow.com/questions/39929347/how-to-set-java-djava-library-path-home-path-somefile-so-in-linux-environmen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!