This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251103 - Command not found issue while using Exec Prefix variable in Remote Java SE
Summary: Command not found issue while using Exec Prefix variable in Remote Java SE
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0.2
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on:
Reported: 2015-03-11 14:14 UTC by chewlm86
Modified: 2015-06-03 15:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

IDE log (181.20 KB, text/plain)
2015-03-11 14:14 UTC, chewlm86

Note You need to log in before you can comment on or make changes to this bug.
Description chewlm86 2015-03-11 14:14:05 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02

I am trying to run/debug my Swing GUI App on my remote raspberry pi, therefore i need to forward it to a running session of vncserver on the raspberry pi.
so i added the following line to the Exec Prefix variable:
DISPLAY=:0 sudo

But it gave me the following output:
cmd : cd '/home/pi/NetBeansProjects//Test_Swing'; 'DISPLAY=:0 sudo' '/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre//bin/java'  -Dfile.encoding=UTF-8   -jar /home/pi/NetBeansProjects//Test_Swing/dist/Test_Swing.jar 
bash: DISPLAY=:0 sudo: command not found

I managed to get it to work by modifying the "remote-platform-impl.xml" file directly:
command="cd '${remote.project.dir}'; DISPLAY=:0 sudo ${remote.platform.exec.prefix}'${}' @{additionaljvmargs} -Dfile.encoding=${runtime.encoding} ${run.jvmargs} ${run.jvmargs.ide} -jar ${remote.dist.jar} ${application.args}"

The successful run gave me the following output:
cmd : cd '/home/pi/NetBeansProjects//Test_Swing'; DISPLAY=:0 sudo '/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre//bin/java'  -Dfile.encoding=UTF-8   -jar /home/pi/NetBeansProjects//Test_Swing/dist/Test_Swing.jar 
BUILD SUCCESSFUL (total time: 11 seconds)

The only difference I see is the between the 2 scenario is the quotation marks.
Comment 1 chewlm86 2015-03-11 14:14:15 UTC
Created attachment 152559 [details]
IDE log
Comment 2 Tomas Zezula 2015-06-03 15:01:10 UTC
Currently the prefix need to be a single command not a shell command chain.
You can workaround it either by change in the build script as you did.
I will extend the exec prefix to support command chain separated by ';' to make the
DISPLAY=:0; sudo work.