Re: [eclipse-clp-users] Java-embedding problem with v6.1 (dev build 85) on Win7 64

From: -dp- <david_at_wooden-robot.net>
Date: Thu, 22 Sep 2011 15:52:57 +0800
On Thu, Sep 22, 2011 at 12:42 PM, Kish Shen <kisshen_at_cisco.com> wrote:

> On 22/09/2011 01:53, -dp- wrote:
>
>> I'm fairly sure the reason for this is that eclipse.exe is an app
>> requiring
>> Admin privileges to execute (since it's in Program Files on Windows7) and
>> my
>> Java app doesn't have my full Admin privileges when it invokes the
>> CreateProcess API of Windows. (I guess TkEclipse doesn't face this problem
>> because it's under the same app folder in Program Files.)
>>
>
> I don't know much about Windows permissions, as fortunately I don't need to
> develop on Windows, but needing admin privileges to run programs in Program
> Files seem strange to me. Also, I don't understand why you did not have the
> same problem with the 32 bit ECLiPSe...which is also installed to Program
> Files (which Windows silently maps to "Programs Files (x86)" -- but I assume
> the same restrictions will apply?)
>


This is a very good point. If I had remembered this, I would have been much
more skeptical of my permissions hypothesis. I also did a test of turning
off UAC (with reboot) and it did not help.

Previously, I had tried attaching src to my IDE to see if I could figure out
the problem, but the IDE couldn't show the values of variables when I
"stepped into" eclipse.jar. After the UAC idea failed, I realized I had to
create a Java project from src. That revealed what appears to be a bug in
EclipseEngineOptions.setEclipseDir()...somehow, when commandline
arg -Declipse.directory="C:\Program Files\ECLiPSe 6.1\" is read-in via
System.getProperties() [line 113], and then processed [lines 153 and 295],
the final double-quote char is left on the end:

   "C:\\Program Files\\ECLiPSe 6.1""

That causes the error I reported, because then in OutOfProcessEclipse on
line 281, cmdarray2[0] is set to "C:\\Program Files\\ECLiPSe
6.1"\\lib\\x86_64_nt\\eclipse.exe" (quote in the middle of the string),
causing the call to fail: eclipseProcess =
Runtime.getRuntime().exec(cmdarray2);

When I edit setEclipseDir() to be this, it works:

  public void setEclipseDir(File eclipseDir)
  {
  String s = eclipseDir.getAbsolutePath();
  if (s != null) s = s.replace("\"", "");
  this.eclipseDir = s;
  }

btw, there is also a fatal compilation bug in EclipseMapColourer.java:
JOptionPane.showMessageDialog() takes 5 arguments, and it seems the '+' at
the end of line 177 should be ',' instead.

David
Received on Thu Sep 22 2011 - 08:00:19 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET