When I run my Java application on a Solaris machine, I'm having issues with a shared library since it is in 32-bit format. How do I make my application run as in 32-bit format so it would be consistent with the shared library? I compile my application in Windows by the way, and I believe it has nothing to do with the bytecodes.
Asked
Active
Viewed 1,324 times
0
-
it will b helpful if you put error message here – NoodleX May 30 '11 at 06:04
-
Actually, it is from this post - http://stackoverflow.com/questions/6172105/wrong-elf-class-elfclass32 – jasonline May 30 '11 at 06:05
-
I'm not exactly sure what your question is. Does this answer your query: http://stackoverflow.com/questions/783662/java-32-bit-vs-64-bit-compatibility – Joachim Sauer May 30 '11 at 06:15
-
@Joachim: I've actually checked that but couldn't find anything useful. I don't have any issue with the bytecodes - as according to that post, it's not implementation-dependent. So, what I want is to run the bytecode so it uses 32-bit libraries because those are the only ones available. – jasonline May 30 '11 at 06:25
-
@jsaonline: in that case simply start your app with a 32bit JVM. – Joachim Sauer May 30 '11 at 06:28
-
@Joachim: Are you saying that I should download 32-bit JRE and use that to run my application? – jasonline May 30 '11 at 06:31
-
1@Joachim Sauer, he's using Solaris. The Java home should support 32-bit operation by default, unlike separate 32-bit and 64-bit packages for Linux and Windows. Of course, my memory only goes as far as recent versions of Solaris, so you might be right for the older versions. – Vineet Reynolds May 30 '11 at 06:33
1 Answers
0
Perhaps the "-d32" flag can help?
http://download.oracle.com/javase/1.5.0/docs/tooldocs/solaris/java.html

Thorbjørn Ravn Andersen
- 73,784
- 33
- 194
- 347
-
The question is a near-duplicate of a previous question - in fact he OP mentioned there, `-d32` didn't have any positive effect. – Andreas Dolk May 30 '11 at 06:42
-
This question does not mention that, and -d32 is _the_ way to indicate the 32/64-bitness of the JVM which is what was asked. This may in turn indicate that the diagnosis is wrong. – Thorbjørn Ravn Andersen May 30 '11 at 06:47
-
It actually didn't do any help, and I don't know why. I tried seeing the process info using ps to see the parameters but '-d32' or '-d64' disappeared. – jasonline May 30 '11 at 06:51
-
@Thorbjørn - sorry, could have been more accurate with my comment ;) There's a discussion in the comments to [this answer](http://stackoverflow.com/questions/6172105/wrong-elf-class-elfclass32/6172255#6172255). – Andreas Dolk May 30 '11 at 06:52
-
@Jason, print out system properties after launch. This Will allow you to deduce the details of the underlying JVM. – Thorbjørn Ravn Andersen May 30 '11 at 07:23
-
@Thorbjorn: yes, I can see it is running as a 64-bit application, even if -d32 is passed, and I don't see the parameter in /usr/ucb/ps. – jasonline May 30 '11 at 07:39
-
@Jason, is the 32-bit JVM even installed? Consider recompiling your shared library for the 64-bit architecture... – Thorbjørn Ravn Andersen May 30 '11 at 08:30
-
@Thorbjorn: Yes, I just found out there's a 32-bit version installed but the current java binary is pointing to the 64-bit versino. I think that's why the -d32 was ignored. Yes, but I don't have the liberty of recompiling the shared library for 64-bit. – jasonline May 30 '11 at 09:07