You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by cactuar <su...@hotmail.com> on 2007/08/24 23:28:19 UTC

Problem running junit on Solaris 64 bit

I am trying to run my JNI code using JUnit within Ant on Solaris 5.8. 
However, it fails to load my shared object and gives me this error message.

Can't load Sparc v9 64-bit .so on a Sparc 32-bit platform

I set the environment variables as following:
JAVA_HOME = /local/apps/java/1.5.0-11-64/jdk1.5.0_11
PATH =
.:./bin:/local/apps/java/1.5.0-11-64/jdk1.5.0_11:/local/apps/java/1.5.0-11-64/jdk1.5.0_11/bin/sparcv9

How is it trying to run on the 32 bit mode while I am trying to run on the
64 bit mode?  Is there something I need to set in my Ant script?

Thank you.
-- 
View this message in context: http://www.nabble.com/Problem-running-junit-on-Solaris-64-bit-tf4325862.html#a12320068
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem running junit on Solaris 64 bit

Posted by cactuar <su...@hotmail.com>.
Thank you.  I am still confused on why I can run my jar file fine with "java
-jar" on a command line, but not with JUnit/Ant.  Are there two kinds of VM
here?  The VM the Ant runs with and another VM that I run on command line?? 
Thank you for your help.

-- 
View this message in context: http://www.nabble.com/Problem-running-junit-on-Solaris-64-bit-tf4325862.html#a12357092
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem running junit on Solaris 64 bit

Posted by Robert Clark <ro...@quest.com>.
On Monday August 27, 2007, cactuar <su...@hotmail.com> wrote:
> Robert Clark-2 wrote:
> > If you are running the JUnit tests inside of Ant, add the "-d64"
> > option to the ANT_OPTS env. variable before starting Ant.
>
> I tried setting the ANT_OPTS env. variable in my environment like
> this; ANT_OPTS=-d64; export ANT_OPTS
>
> But it did not make a difference.  Is this what you meant?

Yup. It was a guess as I did not know if you were running JUnit in the 
same VM as Ant or not.

> I am still not sure why it defaults to 32 bit mode without -d64 (as
> I can run it just fine with java -jar command without it).  If you
> could point me to the documentation explaining this option, I
> appreciate it…

Standard JDK docs: 
<http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html>

"If neither -d32 nor -d64 is specified, the default is to run in a 
32-bit environment, except for 64-bit only systems. This is subject 
to change in a future release."

- Rob





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem running junit on Solaris 64 bit

Posted by cactuar <su...@hotmail.com>.

Robert Clark-2 wrote:
> 
> If you are running the JUnit tests inside of Ant, add the "-d64" option to
> the ANT_OPTS env. variable before starting Ant.
> 

I tried setting the ANT_OPTS env. variable in my environment like this;
ANT_OPTS=-d64; export ANT_OPTS

But it did not make a difference.  Is this what you meant?

However I tried setting this in Ant
<jvmarg value="-d64"/>

It worked!

I am still not sure why it defaults to 32 bit mode without -d64 (as I can
run it just fine with java -jar command without it).  If you could point me
to the documentation explaining this option, I appreciate it…

Thank you very much for your help!
-- 
View this message in context: http://www.nabble.com/Problem-running-junit-on-Solaris-64-bit-tf4325862.html#a12351550
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem running junit on Solaris 64 bit

Posted by Robert Clark <ro...@quest.com>.
On Friday August 24, 2007, cactuar <su...@hotmail.com> wrote:
> I am trying to run my JNI code using JUnit within Ant on Solaris
> 5.8. However, it fails to load my shared object and gives me this
> error message.
>
> Can't load Sparc v9 64-bit .so on a Sparc 32-bit platform
>

> How is it trying to run on the 32 bit mode while I am trying to run
> on the 64 bit mode?  Is there something I need to set in my Ant
> script?

Sounds like the VM is defaulting to 32-bit mode. If you are launching 
a standalone VM for your JUnit tests, try adding the "-d64" command 
line option.

If you are running the JUnit tests inside of Ant, add the "-d64" 
option to the ANT_OPTS env. variable before starting Ant.





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org