Operating System - HP-UX
1819804 Members
2919 Online
109607 Solutions
New Discussion юеВ

determine if java app is 32-bit or 64-bit

 
SOLVED
Go to solution
ahpuser
Occasional Advisor

determine if java app is 32-bit or 64-bit

Hello,

I'm using HP-UX 11.11 (11i) on a HP9000 PA-RISC server.

I have done the following:

1. Downloaded the JRE v5.0.08 from: http://h20392.www2.hp.com/portal/swdepot/try.do?productNumber=JDKJRE5008

2. Installed the JRE.

3. Run a Java application like this:
/opt/java1.5/bin/java -Xmx1024m -cp bin com.examples.Test

I just need to know if this java process is a 32-bit or 64-bit process.

It's important because I have read that there are certain memory limitations for 32-bit applications in HP-UX 11.11.

Thank you very much.
6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: determine if java app is 32-bit or 64-bit

The default is 32 bit. If you want 64 bit you need to use -d64. If you have any JNIs, you would have to port them first.
Gokul Chandola
Trusted Contributor

Re: determine if java app is 32-bit or 64-bit

Hi,
You are right,you have to use 64 bit process.
You have to use 64-bit process instead of 32 bit.

Regards,
Gokul Chandola
There is always some scope for improvment.
Steven E. Protter
Exalted Contributor

Re: determine if java app is 32-bit or 64-bit

Shalom,

You can use the what command on the actual binary.

You can use swlist -a fileset to to analyze the java server binaries.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
ahpuser
Occasional Advisor

Re: determine if java app is 32-bit or 64-bit

Thanks everyone for the replies.

Dennis Handly wrote:
"The default is 32 bit. If you want 64 bit you need to use -d64. If you have any JNIs, you would have to port them first".

I'm a little confused here:
I used to think that a binary file can be either 32-bit or 64-bit (not both).
For example, some applications offers two binary executable files: one is 32-bit and the other is 64-bit.

But what about java? The java binary executable /opt/java1.5/java can produce a 32-bit process or a 64-bit process only by specifying the -d64 flag?


Gokul Chandola wrote:
"You are right,you have to use 64 bit process.
You have to use 64-bit process instead of 32 bit."

How do I use 64-bit process instead of 32-bit?
Just by using the -d64 flag?
Or I need to use another java binary executable (I'm currently using /opt/java1.5/java)?


Steven E. Protter wrote:
"You can use the what command on the actual binary.
You can use swlist -a fileset to to analyze the java server binaries."

I will try those commands as soon as I can.

Any additional information would be great. Thanks.
Dennis Handly
Acclaimed Contributor
Solution

Re: determine if java app is 32-bit or 64-bit

You're thinking too hard, believe in the magic. :-) Just add the -d64 option.

>I used to think that a binary file can be either 32-bit or 64-bit (not both).

There is no binary file here, just instructions in memory. :-)

>some applications offers two binary executable files: one is 32-bit and the other is 64-bit.

Exactly, that's the magic. But typically applications only come one way, only shlibs may have both.

>The java binary executable /opt/java1.5/java can produce a 32-bit process or a 64-bit process only by specifying the -d64 flag?

That's just a 32 bit driver that invokes either a 32 or a 64 bit JVM.

>How do I use 64-bit process instead of 32-bit? Just by using the -d64 flag?

That's correct, read the documentation.
http://docs.hp.com/en/JAVAPROGUIDE/hotspot.html#-d64

>Any additional information would be great.

You can use tusc to see exactly how it works.

>SEP: You can use the what command on the actual binary.

Did you mean the file(1) command instead?
ahpuser
Occasional Advisor

Re: determine if java app is 32-bit or 64-bit

Ok,

> That's just a 32 bit driver that invokes either a 32 or a 64 bit JVM.

That explain everything.

> You can use tusc to see exactly how it works.

I'll do that, thanx.