Bug 225563 - Cannot debug file OR package: "elevation required"
Cannot debug file OR package: "elevation required"
Status: RESOLVED WONTFIX
Product: projects
Classification: Unclassified
Component: Ant
7.2.1
PC Windows 8 x64
: P1 (vote)
: 7.3
Assigned To: Milos Kleint
issues@projects
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-30 21:27 UTC by zweibieren
Modified: 2013-02-01 14:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stack trace (2.57 KB, text/plain)
2013-01-30 21:27 UTC, zweibieren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zweibieren 2013-01-30 21:27:50 UTC
Created attachment 130858 [details]
stack trace

My attempts to debug a file or a project fail with the infamous:

 java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_11\bin\java.exe" (in directory "U:\Fred\java\Indexer"): CreateProcess error=740, The requested operation requires elevation

This message indicates that some permission is not high enough. And yet, 
java.exe and the class files all have at least read and execute permissions. Indeed, NetBeans has no trouble writing into the various project directories.

All routes  to debugging (icon, menu, keyboard F5) fail in the same manner.
Giving ALL permissions to java.exe does not help.

There have been numerous bug reports of CreateProcess error=740, such as, 
    Bug 117803 - java.io.IOException: Cannot run program "C:\JARA-please": 
    Bug 131598 – java.io.IOException: Cannot run program "C:\Users ...
    Bug 156811 – Cannot run program ".netbeans\6.1\config ...
    Bug 157357 – java.io.IOException: Cannot run program "C:\Program ...
    Bug 164417 – java.io.IOException: Cannot run program "C:\Program ...
    Bug 205618 – java.io.IOException: CreateProcess error=740, The ...
    Bug 223863 – java.io.IOException: CreateProcess error=740, The ...
None of these seem to apply to simply trying to debug a program.  Most of them precede Windows 8.
Comment 1 zweibieren 2013-01-30 23:49:47 UTC
The same error occurs if I try to RUN a file or project.
Comment 2 Martin Entlicher 2013-01-31 07:54:49 UTC
This is to be handled in the ANT project IMHO (and the same problem can probably occur in Maven as well).
Comment 3 Milos Kleint 2013-01-31 08:15:28 UTC
please see 
http://mark.koli.ch/2009/12/uac-prompt-from-java-createprocess-error740-the-requested-operation-requires-elevation.html

and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6410605

it's not about the permissions of the java executables but about the permissions of your user on the computer, please make sure you are running netbeans as administrator.

in both ant and maven we IMO don't have direct influence over how the debugged process gets spawned, it's handled by the maven-exec-plugin respectively the java ant task.
Comment 4 zweibieren 2013-01-31 18:34:30 UTC
It may be a bit hasty to mark this bug as "resolved."

a) The failure does NOT occur under x86.
   Even when running as not-an-administrator.
b) I WAS running as administrator on the X64 release. 
   And was not able to run or debug any program.
c) Requiring that NetBeans be run as an administrator
   is a poor policy. Running as administrator 
   is a main route of virus infestation. And it would
   be unpleasant to switch modes just to run NetBeans.
   I often need to browse the web while running NetBeans.

I see that the 704 issue has been unresolved for at least 
five years now. It is about time for a concerted drive to 
find a solution, at least for the NetBeans use-case of 
starting an executable. Oracle. Apache, and NetBeans 
ought to work with Microsoft to convene a meeting to 
find some solution. Perhaps Microsoft can create
special licensing so a few organizations can offer 
selected applications that always run as administrator.
Or perhaps the notion of sandboxes can be generalized.
Comment 5 Milos Kleint 2013-02-01 06:21:13 UTC
well, what is your expected behaviour in this case? The first/all Run/Debug would show the blackscreen asking for permissions?

running all external processes through cmd /c has it's own set of problems as far as I can remember (and afaik requires you to run the command line always as administrator so the problem remains)
Comment 6 zweibieren 2013-02-01 14:16:53 UTC
My expected behavior is that--even with a non-administrator user--NetBeans can start programs without any confirmation from the user. The user has already given implicit permission by running NetBeans.

The above may be impossible with the current UAC. We have to give the program higher permissions than the user. (Remember the SUID bit in Unix?   http://www.codecoffee.com/tipsforlinux/articles/028.html) Perhaps we go a bit further and restrict NetBeans so it and its spawn can only write into a limited number of directories.  

The issue is political and not technical: What is Microsoft willing to do to avoid making development more difficult than necessary? 

There is a time limit. At some point systems will be entirely 64 bit and "Program Files (x86)" will disappear. At that time the fact that NetBeans cannot execute programs will be a deal-breaker.

All this said, with the current NetBeans-Ant system the problem does seem to be in Ant.  The ANT bug data base has only one entry that mentions UAC: 
   https://issues.apache.org/bugzilla/show_bug.cgi?id=50427
I will add another referring to this current NetBeans bug.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo