How to reconfigure eclipse to use the 64-bit JVM

I use eclipse for what I thought was for all 64-bit runtimes. The current Java settings> are installed by the JRE and the runtime all points to jdk1.6.0_30, which is a 64-bit version of the JDK. However, eclipse still believes that it launches the 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 be associated with the shared .so file if it does not work in an environment with a 64-bit environment. (I get word size mismatch errors when I try to do this)

So how can I reconfigure eclipse to run 64bit jvm. Should the eclipse be a 64-bit version?

: on linux

Edit: I tried all the suggestions and nothing works. I changed the execution and environment variables to point to the new JDK, I have 1.6_30. when I run the program from the 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 with the eclipse, which makes it try and run it on a 32-bit JVM. when I try java -d32 -version, it says that the 32-bit environment is not installed, but Eclipse does not know this. I changed the Eclipse.ini file and still nothing works. After these changes, I restarted eclipse ... nothing. Maybe someone who knows the eclipse well, people help me here. thanks

+6
source share
6 answers

Add the -vm tag to eclipse.ini or a shortcut to explicitly indicate the JRE. Please note that by default, Windows XP uses the CRAPPY JRE that ships with Windows.

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

+3
source

In eclipse.ini add:

 -Xmx8g -d64 
+1
source

It works correctly for me !, Make sure your path c: \ Program File is not c: \ Program File (X86) (if you installed the 64-bit JDK, it should store c: \ Program Files)

0
source

Eclipse configuration explained here

0
source

"Installed JREs" (it is better to use the JDK) are used to create and run your code and may have a different architecture or version of Java. The JVM used to start Eclipse is defined in the eclipse.ini file. You must use the version for the JVM architecture.

0
source

Good. It rather caused a headache, but I think I have a solution. After modifying eclipse.ini, go to your project properties. In the Run / Debug settings, edit the launch configuration for your project. In the JRE tag, click the installed JREs. When this dialog box appears, click Search. Go to the folder with your program files, not x86, and let it look for your JREs. When the last appears, deselect the JRE that was currently selected and select the most recent JRE found. I renamed my JRE7-64 so that I can spot the difference. This solved the problem on my part. Good luck.

0
source

Source: https://habr.com/ru/post/906778/


All Articles