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

Summary: Command not found issue while using Exec Prefix variable in Remote Java SE
Product: java Reporter: chewlm86
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 8   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

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}'${remote.java.executable}' @{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 
run-remote:
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.