I am using Netbeans on Linux (Ubuntu 9.04) to create a C project.
How to pass an environment variable so that it appears in the Makefile?
If I do a regular export MYVAR="xyz" and then run make from the command line, this works fine.
But Netbeans doesn't seem to use the .bashrc environment, so if I click "build" in Netbeans, make does not work.
Interestingly, the problem does not occur on MacOSX - I added a variable to ~/.MacOSX/environment.plist , and this value is visible to Netbeans.
I found this post that suggested modifying ~/netbeans-6.8/etc/netbeans.conf . I tried this by adding -J-DMYVAR=xyz to the end of netbeans_default_options , -J-DMYVAR=xyz .:
netbeans_default_options="-J-client -J-Xverify:none -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-DMYVAR=xyz"
But that didn't seem to work.
source share