2

If i run "java -version" it returns 64 bit, which i guess means that my default JVM is 64 bit? but eclipse is using 32 bit since System.getProperty("sun.arch.data.model") returns "32".

I can't use the libraries i need in 32bit mode, jogl which auto detects my platform and incorrectly tries to load a 32bit dll. See more information in my other question: https://stackoverflow.com/questions/14007335/eclipsejogl-issue-cant-load-amd-64-bit-dll-on-a-ia-32-bit-platform

I'm running 64 bit windows 7, eclipse, java and JDK. even tried uninstalling Jre 32 bit to no avail.

Someone else having a similar problem with no solution given: How to reconfigure eclipse to use a 64 bit JVM

Can anyone tell me how i can specify the correct jvm?

Community
  • 1
  • 1
Jacob Jensen
  • 115
  • 3
  • 11

3 Answers3

1

That "trick" is just the normal configuration file for eclipse and it's used to specify the full path for the VM that the user wants to adopt.

The standard JVM also offers the -d64 that tries to force the adoption of the 64 bit memory model.

If you want to keep your environment compatible as much as you can with the libs out there you should keep the 32 bit version, and I'm saying this because of my experience with java, also the 32 bit version is probably more stable than the 64 bit version, especially when interacting with external libs ( again in my experience ).

Anyway keep in mind that you need the 64 bit version of Eclipse, otherwise you will go nowhere.

user1849534
  • 2,329
  • 4
  • 18
  • 20
  • Yeah as i said in comments that got deleted, i already tried changing the ini file, and it didnt work :( obviously i have 64 bit eclipse. – Jacob Jensen Dec 23 '12 at 00:38
  • test that jvm, copy the **full path** to the cmd terminal and add this `-d64 -version` so the result should be something like `C:\path\to\java.exe -d64 -version` . If this fails you don't have a 64 bit capable JVM, you can also try the `-d32` variant if you want to have a confirmation. – user1849534 Dec 23 '12 at 00:41
  • I already tried java -version as noted above, outputting 64 bit. Adding -d64 changed nothing :( EDIT: trying with -d32 replies that it doesnt support 32 bit, which makes sense since i uninstalled 32 bit. Whats wierd tho, is that i just downloaded the 32 bit versions of the library, with which the application works. I guess it's still running the application as 64 bit? O.o – Jacob Jensen Dec 23 '12 at 00:45
  • only need to add -d64 to eclipse.ini – Sergei Krivonos Jul 02 '14 at 17:30
0

You should install a 64 bit version of Eclipse. Or what you can do is edit the Eclipse.ini file, and change the path it uses for java.exe or javaw.exe to start eclipse to point to your 64 bit version. Also make Eclipse.ini is picking up the right JAVA_HOME environment variable, which may be whatever that value is set to in Windows.

Eclipse has environment variables it uses, but it picks most of them up from Windows. If you change the ones in Windows, you need to restart Eclipse to pick up the new values. I think Java changes the JAVA_HOME variable anytime you install a new version.

Logan
  • 2,369
  • 19
  • 20
  • How do you "install" eclipse? i'm just downloading it and running it directly. About the ini stuff, read comment to the above answer – Jacob Jensen Dec 23 '12 at 00:39
  • Sorry about that, I guess you just have to download the 64 bit version like normal. I was using Pulse explorer to have it install for me, but you can download Eclipse 64 bit here. http://www.eclipse.org/downloads/ – Logan Dec 23 '12 at 00:47
  • Yeah i was already using 64 bit, even redownloaded to make sure :P – Jacob Jensen Dec 23 '12 at 00:51
  • Make sure your JAVA_HOME environment is pointing to the 64 bit JDK then, so that Eclipse uses it. – Logan Dec 23 '12 at 02:12
0

Maybe you can tell eclipse where is you own JDK.

Eidt the eclipse.ini in eclipse home dir:

-vm
/path/to/jdk64/bin/javaw.exe 

If you want to compile a project in eclipse with jdk 7, click here.

Community
  • 1
  • 1
lichengwu
  • 4,277
  • 6
  • 29
  • 42