You are not logged in.
Hi,
I have 64bit archlinux. I have installed eclipse and openjdk from repository so both are 64bit version. But I need 32bit version of java for actual job. So i downloaded it from oracle's web. Now I have two java on my arch (./usr/lib/jvm/java-6-openjdk - 64bit and /opt/java/jdk1.6.0_34/ - 32bit). When I changed $JAVA_HOME to 32bit version, eclipse didnt works. So I change $JAVA_HOME back to 64bit.
And my question. If I add new (32bit) java virtual machine to eclipse and select it for use, will be this 32bit version used for programing?
And what about maven? We use maven for build project. Can I set it to use 32bit java?
Thanks
Last edited by funny (2012-08-15 11:52:52)
Offline
I have recently done the same, so...
You don't need to make it complicated.
You only need to do two things:
1. Eclipse Preferences -> Java -> Installed JREs -> Add -> Standard VM -> (set the directory of the 32 bit java in JRE home and give it a name like "32 bit java" or whatever)
2. After creating a project, rightclick -> properties -> Java Build Path -> Libraries -> (remove JRE System Library) -> Add Library -> "JRE System Library" -> (in Alternate JRE choose your "32 bit java" or whatever)
It should now compile and execute with the 32 bit java
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
And what about maven? We use maven for build project. Can I set it to use 32bit java?
Offline
No idea, I don't use maven, but maybe it uses JAVA_HOME when you invoke it with
JAVA_HOME=/whatever mvn
?
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
This is the problem. I have to set JAVA_HOME to 64bit version beacause eslipse, virtualbox, ... need it, but maven use java from JAVA_HOME too and I need that maven use 32bit version as eclipse
Offline
you can create a script that wrapps maven with 32 bit java
Call it sth like mvn32 , put this to your $HOME/bin direcotry and insert following:
#!/bin/sh
export JAVACMD=/path/to/java-32/bin/java
#or
#export JAVA_HOME=/path/to/java-32/
mvn $*
Then you call mvn with mvn32 clean install for example.
When name this scipt mvn and ensure that $HOME/bin is the first entry in your $PATH variable this scipt will be excuted as first when you call mvn
An other alternative is edit /opt/maven/bin/mvn
and adjust the JAVA_HOME Variable to your 32 bit jdk-
Framas
Offline
In the past I returned to 32 bit system.
Now I have new laptop with more RAM and I have installed 64bit archlinux. But I have still this problem.
I need 32bit java beside 64bit. Now i have 32bit java installed from oracle pages. I unpacked tar with 32 bit java to /opt. But when I call java -version or /opt/jdk1.7.0_67/bin/java -version, I see error "Direcory or file /opt/jdk1.7.0_67/bin/java doesnot exists". I dont know where is problem because the file and path is right.
On the first I wanna install and set 32 bit java then I will install 64 bit java for netbeans.
Offline
have you tried one of these AUR Packages?
https://aur.archlinux.org/packages/?O=0 … _Search=Go
Offline
Side note about JAVA_HOME:
You mention you "changed" JAVA_HOME to "32bits" and back to "64bits". If you use packages from extra, JAVA_HOME needs to be set to /usr/lib/jvm/java-default-runtime as set in /etc/profile.d/jre.sh
See this for more info
Offline
Create a 32-bit VMWare machine and install Java, Eclipse, and Maven there. This will avoid all the headaches you're having about trying to get one to work with the other. Use a 32-bit environment if you're developing for a 32-bit system, that's the whole purpose of a virtual machine, to emulate the environment.
As an aside, I fail to understand the reason for 32-bit vs 64-bit as Java is not architecture dependent. The code SHOULD be the same after all.
Offline
As an aside, I fail to understand the reason for 32-bit vs 64-bit as Java is not architecture dependent. The code SHOULD be the same after all.
I agree. As a Java developer, I am curious as to why you specifically need a 32-bit JVM.
Offline