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 08:53:23 +0800
On Tue, Sep 20, 2011 at 6:33 PM, Kish Shen <kisshen_at_cisco.com> wrote:

> Hi David,
>
>
> On 20/09/2011 08:14, -dp- wrote:
>
>> On Tue, Sep 20, 2011 at 11:29 AM, -dp-<david_at_wooden-robot.net>  wrote:
>>
>>  Exception in thread "clpThread" java.lang.RuntimeException: Unsupported
>>> platform: Windows 7/amd64
>>> at com.parctechnologies.eclipse.**Platform.findPlatform(**
>>> Platform.java:122)
>>>
>>> Btw, I looked at the source of the findPlatform method,
>>>
>>
>> eclipse_src\Eclipse_6.1_88\**JavaInterface\src\com\**
>> parctechnologies\eclipse\**Plaform.java
>>
>>
>> and I don't see how this exception could have been thrown. The code checks
>> if the "os.name" System property starts with "Windows" (the value printed
>> above indicates the property value is "Windows 7") and if the "os.arch"
>> System property is equal to "amd64" (the value printed above shows that it
>> is), and in this case the code should return a new Platform_x86_64_nt
>> object.
>>
>
> Well, if you are running Platform.java from ECLiPSe 6.0, then you should
> see this error with arch amd64, so my guess is that you must somehow be
> running the 6.0 Platform.java.
>
> You mentioned that you are using EclipseIDE. Are you also using Saros (the
> ECLiPSe plug-in for EclipseIDE), by any chance? I don't think I have even
> tried running Saros with 64 bit Windows, and I doubt that the code have been
> updated to work with 64 bit Windows.
>
> I really don't know enough about EclipseIDE or Saros to be of much help
> beyond this...


I found two problems:

1) I had forgotten to replace the 6.0 eclipse.jar in my app's lib folder
with the one from 64-bit 6.1

2) Now I get the following error:

java.io.IOException: Cannot run program "C:\Program Files\ECLiPSe
6.1"\lib\x86_64_nt\eclipse.exe": CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
at
com.parctechnologies.eclipse.OutOfProcessEclipse.startLocalEclipse(OutOfProcessEclipse.java:281)

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.)

Possible fixes might include turning off User Account Control in the Win7
control panel, or giving my Java app Admin execution rights, but these both
seem overly permissive security-wise. And any CLP user in a similar
situation would have to do the same.

Two things the dev team might want to consider are:

a) Detect the OS during install, and if it's Vista or later, provide a
suggestion in UI that if the user plans to embed CLP while using UAC, then
check this box to install in a location outside of Program Files.

b) Popup a UAC prompt during runtime, perhaps using the techniques described
here:
http://www.codeproject.com/KB/vista-security/UAC__The_Definitive_Guide.aspx
(btw,
the wikipedia page on UAC also describes a technique, but the just-linked
page suggests that technique isn't secure.)

I'm not sure what I'm going to do short-term. I guess I'll try to give my
app or the IDE admin execution privilege.

David
Received on Thu Sep 22 2011 - 00:53:31 CEST

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