Select to view content in your preferred language

Running a Java map application with a 32 bit JRE from within Eclipse

3380
4
Jump to solution
05-04-2013 03:09 PM
JasonJacob
Emerging Contributor
I'm trying to run a ArcGIS map UI out of Eclipse (Indigo) using a 32-bit JRE on a 64-bit Windows 7 machine. The reason I'm trying oto use a 32-bit JRE is because I need to a load a 32-bit native library for my project.

To build up to the problem here is an experiment I tried:
Using a 32-bit JRE and running out of Eclipse???

  1. I first created a dummy console application printing a simple message and that worked (of course).

  2. I made the application pop up a simple JFrame and that worked. A blank window pops up.

  3. Next I added the ???ArcGIS Runtime Java Dependent JARs??? library to the build path. But, I didn???t add any ArcGIS UI elements to my application UI at all nor did I add any ArcGIS related objects to my code. This also runs and a blank window pops up.

  4. Next I instantiated a simple JMap (new JMap()) object and did not add it to the frame yet. This is when the program terminates without popping up a window.

  5. If I leave the code as is and just change the JRE being used by that Eclipse project to a 64-bit version, it runs.

I can build and run all this on the command line outside of Eclipse, but this is my IDE of choice and I would love to debug my application within Eclipse as I normally would.
0 Kudos
1 Solution

Accepted Solutions
JasonJacob
Emerging Contributor
It's ok. I worked around this by running the application from the command line and attaching a remote debugger from Eclipse.

View solution in original post

0 Kudos
4 Replies
CarlosColón-Maldonado
Frequent Contributor
Have you tried launching eclipse with the specific 32bit Java Runtime Environment? This link shows how to do that.

To explicitly specify a JVM of your choice, you can use the -vm command line argument:

   eclipse -vm c:\jre\bin\javaw.exe              ''start Java by executing the specified java executable
   eclipse -vm c:\jre\bin\client\jvm.dll         ''start Java by loading the jvm in the eclipse process

0 Kudos
JasonJacob
Emerging Contributor
I just tried a few of the suggestions including add the -vm flag to the eclipse.ini file, but it returns with an error code.

For example if I try to run a 32-bit version of Eclipse with following -vm flag then I get the screenshot below:
-vm
C:/Program Files (x86)/Java/jdk1.7.0_21/bin/javaw.exe
[ATTACH=CONFIG]24061[/ATTACH]
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
I looked up the error code from your screenshot on Google and found links that say:
Is an application error code you will find on Windows computers which use a (certain) video card.
Several links seem to blame the screensaver for this error, but sounds like the 32-bit JRE seems to have a problem assessing the video card on a 64-bit OS in JMap's behalf, because it requires direct access to it, based on what you've done to corner this behavior on your first post.

Because Runtime comes with both sets of x86 and x64 client/server libraries for Windows deployments, I'm led to believe that you will not be able to have Runtime specifically use the x86 libraries to operate on a x64 OS. I think you'll have hard time getting this to work. Sorry I couldn't be of help.
0 Kudos
JasonJacob
Emerging Contributor
It's ok. I worked around this by running the application from the command line and attaching a remote debugger from Eclipse.
0 Kudos