Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used Path variable #159

Closed
StefAlb opened this issue Jan 9, 2018 · 4 comments
Closed

Used Path variable #159

StefAlb opened this issue Jan 9, 2018 · 4 comments

Comments

@StefAlb
Copy link

StefAlb commented Jan 9, 2018

Used Path variable

If I open a windows command shell via easyshell, the shell does not use the configured system "Path" environment variable ... in opposite if I open a command shell outside eclipse.

What can I do to change this?

  • Plugin version: 2.1.0.v20170508-1844
  • Eclipse Version: Oxygen.2 Release (4.7.2) Build id: 20171218-0600
  • Java Version: jdk1.8.0_151
  • Operating System Version: Windows10
@anb0s
Copy link
Owner

anb0s commented Jan 11, 2018

I'm sure it must work, because i'm using it daily. Please call in your opened command shell:
echo %PATH%
and check if it shows same pathes from your system "Path" environment variable.

@StefAlb
Copy link
Author

StefAlb commented Jan 11, 2018

I had done this and I would also expect that it's works ... I had never this problem in the past until last week and I use easyshell since years. At the moment I assume that this is an OS or eclipse problem.

However the problem disappears yesterday and I had it again today. But after a restart of eclipse the problem had gone again. So I hope this was a local issue on my PC.

@anb0s
Copy link
Owner

anb0s commented Jan 11, 2018

Thanks for the feedback! I've looked in the code and see that i'm using "ProcessBuilder" here and do not touch the environment (commented out). As expected from description it just passes the environment from Eclipse process (initial value), so Path etc. should be good:

an environment, which is a system-dependent mapping from variables to values. The initial value is a copy of the environment of the current process (see System.getenv()).

I think it can be OS, Eclipse process or Java process... hm...

Code:

    	// get working directory
    	File workingDirectory = getWorkingDirectoryResolved(variableManager);
        // get command    	
        String[] command = getCommandResolved(variableManager);
        // create process builder with command and ...
        ProcessBuilder pb = new ProcessBuilder(command);
        // ... set working directory and redirect error stream
        if (workingDirectory != null) {
            pb.directory(workingDirectory);
        }
        Activator.logDebug("exc:<---");
        // get passed system environment
        //Map<String, String> env = pb.environment();
        // add own variables
        pb.start();

@anb0s
Copy link
Owner

anb0s commented Mar 1, 2018

Close this one, because it looks like OS or Eclipse issue. Please reopen if it's still reproducible. Thanks!

@anb0s anb0s closed this as completed Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants