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 22195 - Allow to define a set of environment variables.
Summary: Allow to define a set of environment variables.
Status: CLOSED DUPLICATE of bug 47511
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-08 16:22 UTC by Marian Petras
Modified: 2010-04-29 09:09 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
build-impl.xml changes to support definition of LD_LIBRARY_PATH (23.71 KB, text/xml)
2005-10-12 17:59 UTC, jmwhite5
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2002-04-08 16:22:59 UTC
Some applications require extra system variables
to be set (such as LD_LIBRARY_PATH). Debugger does
not allow to set them.

It is not be problem for most system variables
because:
- on MS Windows, system variables are available to
all executed applications
- on Unix systems, if a variable is exported in a
shell, it is available to all applications started
from the shell and its subshells

BUT:
JVM changes values of some system variables (e.g.
LD_LIBRARY_PATH) so original values (values before
NetBeans/FFJ was executed) of such variables is
not available to the applications started from NB/FFJ.
Comment 1 Marian Petras 2002-04-08 16:27:06 UTC
Required changes:

- UI
- modify org.netbeans.modules.debugger.jpda.Launcher
  (find string "debuggerProcess.exec")
Comment 2 Marek Grummich 2002-07-22 09:16:14 UTC
Target milestone was changed from '3.4' to TBD.
Comment 3 Marek Grummich 2002-07-22 09:20:04 UTC
Target milestone was changed from '3.4' to TBD.
Comment 4 Martin Entlicher 2005-05-16 14:15:33 UTC
The debugger is launched from an ANT script now. The possibility to define
environment variables needs to be explored and possibly added into UI.
Comment 5 jmwhite5 2005-09-13 00:26:53 UTC
I order for me to define LD_LIBRARY_PATH with netbeans 4.1, I had to edit my
project's build.xml and override the following targets (at the bottom of the
file, just before </project>) :

    <target xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"
name="run" depends="init,compile" description="Run a main class.">
        <j2seproject1:java>
            <customize>
                <env key="LD_LIBRARY_PATH" path="${application.env}"/>
                <arg line="${application.args}"/>
            </customize>
        </j2seproject1:java>
    </target>

    <target xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2"
name="-debug-start-debuggee" depends="init,compile">
        <j2seproject2:debug>
            <customize>
                <env key="LD_LIBRARY_PATH" path="${application.env}"/>
                <arg line="${application.args}"/>
            </customize>
        </j2seproject2:debug>
    </target>

    <target xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" 
name="-debug-start-debuggee-single" if="netbeans.home"
depends="init,compile-single">
        <fail unless="debug.class">Must select one file in the IDE or set
debug.class</fail>
        <j2seproject2:debug classname="${debug.class}">
            <customize>
                <env key="LD_LIBRARY_PATH" path="${application.env}"/>
            </customize>
        </j2seproject2:debug>
    </target>


And then, in private.properties, I define application.env to be my
LD_LIBRARY_PATH value.

It would be nice to have UI support for this, as it is very common on Unix/Linux
to need to set this env var. (java.library.path only works for the first level o
libraries invoked from java.  If a shared object in turn depends on another
shared object, the LD_LIBRARY_PATH needs to be defined).

/jm
Comment 6 jmwhite5 2005-10-12 17:58:39 UTC
I am raising the priority of this bug, because I'll never be able to convince
the other 40 Eclipse developers to switch to Netbeans if something this basic
cannot be done through the GUI. (There are just 2 netbeans developers right now...)

As a work around, the stock project file "build-impl.xml" could be modified as
my attachment demonstrates to make it easy to define a LD_LIBRARY_PATH variable
in the private.properties file (just add application.env.ldlibrarypath)
Comment 7 jmwhite5 2005-10-12 17:59:48 UTC
Created attachment 25884 [details]
build-impl.xml changes to support definition of LD_LIBRARY_PATH
Comment 8 Jesse Glick 2005-11-04 16:30:21 UTC

*** This issue has been marked as a duplicate of 47511 ***
Comment 9 Quality Engineering 2010-04-29 09:09:58 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.