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

how to add the environment variable to the cmder? #792

Closed
OriLiMu opened this issue Jan 8, 2016 · 10 comments
Closed

how to add the environment variable to the cmder? #792

OriLiMu opened this issue Jan 8, 2016 · 10 comments

Comments

@OriLiMu
Copy link

OriLiMu commented Jan 8, 2016

82

Just like it shows in the picture, left is the cmder , and right is my windows cmd
two questions here:

  1. I already add the mysql path to the environment in the environment why cmder still can't find it?
  2. every time I start the cmder it shows that mysql is not a internal or external command why's that ?
@MartiUK
Copy link
Member

MartiUK commented Jan 8, 2016

Try adding double quotes " before and after mysql in path.

@OriLiMu
Copy link
Author

OriLiMu commented Jan 9, 2016

82
you mean like this? It worked, but I can't type the whole path every time.
82
And the path is already added in the environment variable.

@jankatins
Copy link
Contributor

I use this in config/user-startup.cmd (needs the changes in the development branch -> see the appveyor artifacts)

:: add my own scripts
@set "PATH=%PATH%;%CMDER_ROOT%\vendor\heimdall"
@set "PATH=%PATH%;C:\portabel\sdk\platform-tools"

:: add unix commands from existing git -> last to get the right gpg from above and not from git...
@set "PATH=%PATH%;%GIT_INSTALL_ROOT%\usr\bin\"

But this shouldn't be needed if msql is included in the path (-> if it is useable in a plain cmd, it should be useable in cmd, as we only add to the path).

Can you give the output of path in both cmd and cmder?

In your case something more seems to be broken as {lamb} and {git} is not replaced with the right values.

@OriLiMu
Copy link
Author

OriLiMu commented Jan 12, 2016

Tnx a lot for your help, the problem is solved.

@jankatins
Copy link
Contributor

Close?

@OriLiMu OriLiMu closed this as completed Feb 1, 2016
@OriLiMu
Copy link
Author

OriLiMu commented Feb 1, 2016

tnx

@OriLiMu OriLiMu reopened this Feb 1, 2016
@OriLiMu OriLiMu closed this as completed Feb 1, 2016
@AWBuchanan7
Copy link

I seemed to be having this same problem and on looking further into it the issue may be on Cmder's end:

2016_03_08_21_35_54_cmder

I realized that my %PATH% was being cut short in Cmder:
2016-03-08 21_47_42-cmder

It would appear that a default MySQL installation adds this to %PATH%:

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;

Any and all characters following that ampersand (and including the ampersand) are then truncated by Cmder. This effectively was ignoring a large amount of my %PATH%.

There may be need to 'escape' the ampersand so that %PATH% doesn't get incorrectly cut short.

For the time being I have removed MySQL from my %PATH% and Cmder is working as expected, however in the long term I wonder if there is a better solution for this?

@PhillipMwaniki
Copy link

This issue is resolved once you remove the auto inserted MySQL paths from the system variables path. Nodejs wasn't working for me but now is. Does anyone know how to start up using a command e.g.
cmder .
to open cmder in a particular folder without right clicking. I'm using listary and I think this would be helpful

@teuber789
Copy link

I've got the same problem, except that it's for java.exe.

Java is installed in the default location: C:\Program Files\Java\jdk-10.0.2.

As part of the installation, I defined the following new variable:

JAVA_HOME=C:\Program Files\Java\jdk-10.0.2

I then added this to the path variable, like so:

%JAVA_HOME%\bin

I tested it by running where java from cmd.exe. I get the following:

C:\Program Files\Java\jdk10.0.2\bin\java.exe

But when I run where java from cmder, I get the following:

INFO: Could not find files for the given pattern(s).

@dav0
Copy link

dav0 commented Jan 25, 2019

I was able to get JAVA_HOME working for Cmder by using the old PROGRA~1 trick to work around the issues caused by the silly space character in "Program Files".

Try placing the following into your user_profile.cmd (customized for your particular jdk version):

@set JAVA_HOME=C:\PROGRA~1\Java\jdk1.8.0_152
@set PATH=%JAVA_HOME%\bin;%PATH%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants