java.lang.RuntimeException: Registry initialization file not found - java

When I work with JAI from the Eclipse (all the classes specified)
it works very fine, but when I bundle everything in a jar and make a shell script file from that and try to run that script I have a problem with javax.media.jai.OperationRegistry
looking for a initialization file.
Has anyone else seen this problem?
Exception:
java.lang.RuntimeException: Registry initialization file not found.
at
javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:365)
at javax.media.jai.JAI.(JAI.java:566)
There is something on this page but I was not able to understand.
Any Help?

So the problem is that the JAI jar exported with the Java application do not work on the Linux. We have to explicitly install JAI on the Linux machine for the installed Java application to use.
The one solution that we found out is we exported our Java Application into a jar file and created a installation script, which when run on the Linux machine install the JAI first and after that it install our application.
So this is a one time installation process while installing the application on any fresh Linux machine.

Related

Running an android binary on Ubuntu (libc.so: invalid ELF header)

I am trying to run a java application on spring boot running on ubuntu. My application has a dependency on a jar file that loads two binaries:
"libc++_shared.so" and "libsigx.so"
I extracted the jar file and so files from an aar file that is created as a dependency for android, but I would really like to use this on my server. I was able to write the java code I need without an issue after I added the jar file as dependency to my spring boot application.
However, when these binaries are loaded(e.g System.loadLibrary("c++_shared")) in Java, I got an exception saying that libc.so is not found. Apparently, I needed to install some other binaries, so I installed the necessary binaries to my docker container by using
sudo apt-get install build-essential
Now I have all the binaries needed(libc.so, libm.so etc), but now when I run my jar file I get invalid ELF header exception:
Caused by: java.lang.UnsatisfiedLinkError: /usr/java/packages/lib/libc++_shared.so: /lib/x86_64-linux-gnu/libc.so: invalid ELF header
When I run the readelf -h command on so files:
The c++ so file has OS/ABI: UNIX - System V header, while libc.so has OS/ABI: UNIX - GNU. Looks like binaries are not compatible and I am trying to find to solve this.
Couple of questions that come to mind are:
Is it possible to get these binaries to run in a compatible way with some commands? Maybe convert binary for system v to gnu somehow?
Is it possible to find "libc++_shared.so" and "libsigx.so" created for OS/ABI: UNIX - GNU
I am open to any workaround to get these libraries running together. Thanks

Find the running Jar File in a JPackage Program

How can I find the Jar File that my Program is running from, when it is being packed using jpackage (as a URI, URL or File)? I could easily do this on Windows because I know where it is going to be installed, but I would like to make this work on all platforms (Windows, Linux and MacOS). I am unable to experiment with this since I don't have a Mac nor a Linux Machine.
I want to be able to update my Application before/after starting it.
Thanks!

Java Unable to load libary 'tesseract' not found in resource path [duplicate]

I've had tesseract and Tess4J running on my MBP for a while now. Today I started to migrate my app to the server and started installing everything on the server. Prior to running Tess4J in tomcat I tried to run a simple java program to make sure everything is fine and dandy. It's not...
I'm on a centOS 64bit server
I've installed tesseract and its working fine - tesseract myimage.jpg mytext produces data
However, running my simple class that useses Tess4j produces this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to
load library 'tesseract': libtesseract.so: cannot open shared object
file: No such file or directory
What I've done so far
I've ran sudo ldconfig after installing tesseract
I've search for libtesseract.so and its found in /usr/local/lib/libtesseract.so
Folder on server contains these files:
myimge.png
ghost4j-0.3.1.jar
jai_imageio.jar
jna.jar
maslab.jar
pngj.jar
tess4j.jar
TesseractExample.class
TesseractExample.java
tesseract -v produces:
tesseract -v
tesseract 3.02.02
leptonica-1.69
libjpeg 6b : libpng 1.2.49 : libtiff 3.9.4 : zlib 1.2.3
Question
How can I make Tess4J aware that libtesseract.so does exist?enter code here
I had this problem too.
Did you run the following after installing tesseract:
sudo ldconfig
That fixed it for me.
You must set LD_LIBRARY_PATH environment variable to the path where libtesseract.so is.
export LD_LIBRARY_PATH=/usr/local/lib
It is necessary to define the variable jna.platform.library.path. For instance:
-Djna.platform.library.path=/usr/local/lib/
Maybe it is a 32 bit library .so installed.

How to execute Carrot2 Document Clustering server

I downloaded the Carrot2 Document clustering server build 3.15.0 for Mac. The read me file says:
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
Mac OS Sierra doesn't make it easy, but I got 1.8.0_112 installed.
The problem is that I don't know how to execute the 'dcs' script.
There are .cmd, .sh, .war, and .jar files. I wasn't sure which of those to work with. I thought .jar looked promising, so I followed some of this thread and tried this in a terminal window:
java -jar invoker.jar
I cd-ed to the correct directory, but it just says Provide main class, but I'm not sure what or where that is.
Can anybody provide instructions or a link to how to do this?
Use the dcs.sh (on Linux/Mac) and dcs.cmd (on Windows) to start the server. The scripts will set some extra options for the JVM and then start the DCS. In case of any problems, append the -v option to see diagnostic output.

After uninstalling JPfofiler ( from Ubuntu ) when i run my application in Netbeans,it shows Error

I installed JProfiler, after 2 days i uninstall Jprofiler (in Ubuntu) but when i run my application Netbeans IDE shows following Error:
Error occurred during initialization of VM
Could not find agent library /home/bsoft/jprofiler7/bin/linux-x86/libjprofilerti.so in absolute path, with error: /home/bsoft/jprofiler7/bin/linux-x86/libjprofilerti.so: cannot open shared object file: No such file or directory
Please help me to solve this problem.
Finally i solved the problem.
i just removed two files(startup_jprofiler.sh, setenv.sh) from my tomcat installation directory(/var/lib/tomcat6/bin).**
Please first make sure that, your JVM is working or not. Try to start JVM from command prompt. It you are able to launch java.exe file then there are some problems with your project.
You are using netbeans. So before starting netBeans remove cache of netBeans. There are changes that your netBeans is pointing to old class path of jProfiler.
Regards,
Gunjan.

Categories

Resources