Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reconfigure eclipse to use a 64 bit JVM

I'm using eclipse on what I thought were all 64 bit runtime environments. The current settings Java>installed JREs and Execution Environment all point to jdk1.6.0_30 which is a 64 bit version of the JDK. However, eclipse still thinks it's running a 32 bit version because when I run:

System.getProperty("sun.arch.data.model");

it returns 32 instead of 64.

And the external JNI resource that I compiled for 64 bit machines will not link to the shared .so file unless it's running in a 64 bit enviroment. (I'm getting word size mismatch errors when I try to do this)

So How can I reconfigure eclipse to run 64 bit jvm. Does eclipse itself have to be a 64 bit version?

:on linux

Edit: I have tried everyone's suggestions and nothing is working. I've changed the execution, and enviroment variables to point to the newst JDK I have which is 1.6_30. when I run the program from a command line I get 64 and amd64 as the value when I run the same program in eclise I get 32 and i386. Something is wrong in eclipse that is causing it to try and run it on a 32 bit JVM. when I try java -d32 -version it says that a 32 bit enviroment isn't installed but Eclipse doesn't know that. I've modified the Eclipse.ini file and still nothing is working. I've restarted eclipse after these changes...nothing. Can some one who knows eclipse well people help me out here. thanks

like image 365
Randnum Avatar asked Jan 24 '12 17:01

Randnum


People also ask

How do I change from 32 bit JVM to 64 bit JVM?

In the menu, click Settings > Active Profile. Click the Java icon and then the Advanced tab. Select 32-bit Java (default) or 64-bit Java.

Is JVM 32 or 64 bit?

Client JVM is only available for 32-bit JVM and not for 64-bit.

Which JVM does Eclipse use?

The latest release of Eclipse requires a 64-bit JVM, and does not support a 32-bit JVM. Current releases of Eclipse require Java 11 JRE/JDK or newer. A Java Development Kit (JDK) includes many useful extras for Java developers including the source code for the standard Java libraries.


2 Answers

Add the -vm tag to eclipse.ini or the shortcut to explicitly specify a JRE. Note that the default for Windows XP is to use the CRAPPY JRE that comes with Windows.

-vm "%JAVA_HOME%/bin/javaw.exe"

like image 60
Chris Nava Avatar answered Oct 11 '22 01:10

Chris Nava


In eclipse.ini add:

-Xmx8g
-d64
like image 35
Sergei Krivonos Avatar answered Oct 11 '22 00:10

Sergei Krivonos