10
votes

I'm getting this error pointing to some .so file when running my application on a Solaris machine. However, the application runs just fine in my Windows machine. If I'm not mistaken, my application is expecting for the 64-bit version but I only have a 32-bit version of the .so file in the Solaris machine. Is there a way I can fix this so it will use the 32-bit version instead? I understand it has nothing to do with the bytecodes but probably with the JVM. I tried running using -d32 or -d64 but it has no effect.

UPDATE:

This is the exact error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: librvjs11.so: ld.so.1: java: fatal: librvjs11.so: wrong ELF class: ELFCLASS32<br>
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br>
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)<br>
    at java.lang.ClassLoader.loadLibrary(Unknown Source)<br>
    at java.lang.Runtime.loadLibrary0(Unknown Source)<br>
    at java.lang.System.loadLibrary(Unknown Source)<br>

I've already updated LD_LIBRARY_PATH so it includes the directory containing the file above.

2
"I'm getting this error"... What error are you speaking of? Posting the error reported will help people understand what you are referring to.Vineet Reynolds
@Vineet: jasonline means a "wrong ELF class" error. If you've ever seen one, it doesn't carry much information -- just the filename. It does indeed mean that the app is trying to use a 32-bit binary in a 64 bit environment.trutheality
@trutheality, I know what it corresponds to. The important thing however is that it can be reported in the context of an UnsatisfiedLinkError. Therefore, without knowing the failure involved, and the files in question, it is going to be very difficult to aid in troubleshooting. I would have suggesting looking at the contents of LD_LIBRARY_PATH, but that would be presumptuous.Vineet Reynolds
@Vineet, thanks for clarifying.trutheality
@rutheality, you're welcome. For now, your answer might help the OP perform some basic troubleshooting, but unless it is known what library failed to load, I'm afraid there is very little psychic debugging that one can do.Vineet Reynolds

2 Answers

8
votes

Based on the conversation in the other answer, it was inferred that the JVM was a 64-bit process. This was confirmed using the pflags command in Solaris.

Apparently the -d32 flag passed to the JVM was being ignored. This was due to the possibility of the JVM being a 64-bit one, which was incapable of operating in the 32-bit mode. The resolution might therefore be to install a 32-bit version of JVM, and use the same.

3
votes

What I think is happening is that your app is using a library that has its own pre-compiled binaries, and those are 32 bit.

Your options are either to get a 64 bit version of the binaries, or force java to run in 32 bit which is what -d32 is supposed to do. However, can the jvm on that machine run in 32 bit? If it can't then the -d32 will cause java to spit out a warning that it can't run in 32 bit and that it will continue in 64 bit. Are you getting that warning?

I'ma CW this since Vineet is doing all the helping.