Batch file in eclipse path variables not found - eclipse

I want to start a batch-script in my eclipse. (Instructions here: How to run a batch script (.bat file) from eclipse)
In my batch file i need some commands like pear or phing.
I put the path to these commands into my environment variable called PATH.
(Works fine with cmd manually)
After starting the script, I'm getting this error:
'pear' is not recognized as an internal or external command,
operable program or batch file.
If I type pear by hand, it doesn't work either.

You need to restart Eclipse after changing the system environment; environment variable changes requires any process that is already running to be restarted in order for that application to pick up the changes.
Another option might be to put the full path to those commands in the .bat file so that it doesn't rely on the system environment in order to work properly.
Tip: Make sure to close and start eclipse afresh for PATH variable changes to take effect. Using the Restart option in File menu may not help here.

Related

'very_good' is not recognized as an internal or external command, operable program or batch file

I tried to activate very_good_cli in flutter with this command:
dart pub global activate very_good_cli
and result was this:
...
...
...
Building package executables...
Built very_good_cli:very_good.
Installed executable very_good.
Warning: Pub installs executables into ~\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
I also added ~\AppData\Local\Pub\Cache\bin to system Path, but this warning still persists and the error I get is:
'very_good' is not recognized as an internal or external command,
operable program or batch file
how can I solve this?
I just wanted to quickly put this together to make it obvious.
After running...
dart pub global activate very_good_cli
very_good.bat is added to your ~\AppData\Local\Pub\Cache\bin directory. So, you need your command-line shell to pick up on this change.
As mentioned above, if you run dart pub global activate very_good_cli a second time it will give you some good info in the form of a warning
Warning: Pub installs executables into `~\AppData\Local\Pub\Cache\bin`, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
So, if the warning states the ~\AppData\Local\Pub\Cache\bin is not in your path, you need to add it there. Something like this. This essentially allows your command-shell to recognize 'very_good' as a command.
Link to video showing the process of adding to path
Once you are done with that, you need your command-line shell(s) to pick up the change. Easiest way to do that is to close them completely and reopen them. A tricky situation you might run into is if you are using a shell inside of another process. I use powershell terminal in vscode. So, I had to close vscode to actually refresh the terminal.
Restarting your computer is the nuclear button that should get the issue resolved if your Environment Variables are setup correctly or if there isn't some other wonky issue with the shell you are using. Using the built in windows cmd is a good test to see if it is just a problem with your preferred shell.
So after running dart pub global activate very_good_cli and adding path to ...\Pub\Cache\bin to the Path in system environment variables, restarting the windows solved the issue.

SML/NJ Error in Command Prompt

So I installed SML/NJ in Windows 10 using the Windows Installer Package "smlnj-110.79", and following the instructions in this coursera video lecture, i should be able to open the command prompt and access sml by typing "sml". However, when I return "sml" I'm prompted that "sml is not recognized as an internal or external command, operable program or batch file". I should note that it works fine if I open the actual SML/NJ program itself. I am trying to use SML/NJ within emacs, will this affect that? Thank you!
You need to add the directory containing SML to your system path. On my machine the path entry is C:\Program Files (x86)\SMLNJ\bin\. See this for modifying the path in Windows 10. If you haven't manually edited your path before (which seems to be the case given the question) you do need to be careful to add to rather than overwrite the current path. Windows has always been clunky in making this possible. This is an article that suggests some utilities. I haven't tried them, so I can't vouch for them.

Can't get eclipse to run terminal command on mac

I have installed swig on my mac and it works in the console just fine. If I type swig -verison in terminal it spits out the version. Eclipse keeps telling me that it can't find swig. I am using the liquidfun library http://google.github.io/liquidfun/SWIG/html/index.html and it told me to put this export SWIG_BIN=$("which" swig) in .bashrc, which I did. This enviroment variable registers through terminal as well. Eclipse STILL won't grab swig properly. What the hell?
Bash reads .bash_profile, .bash_login or .profile. I don't expect the Eclipse process to load such a file (although I could be wrong) nor the SWIG_BIN variable to augment its search path for executables, but if you launch Eclipse from the shell, it should inherit the shell's environment variables.
Try running swig from eclipse using a full absolute path (the one that "which" returns).
The eclipse.ini file can set some startup parameters but perhaps not the path. There might be other eclipse startup files.
Another possibility is to add swig's directory to the path in a login script. (To test that, log out and back in, then start eclipse.)

Reloading/Recompiling/Refreshing .beam files inside a terminal

I use Eclipse and Erlide to develop in Erlang. To run the software I enter the ebin/ directory with my terminal since I don't like the console Eclipse provides. However after each change I have to exit and re-enter erl in the terminal to reload the .beam files that have been changed. Eclipse automatically generates new .beam files into the ebin/ directory after every save.
I know I can manually compile it with the c(filename) command, but that would require me to move to the src/ directory, compile the files, and move them back to the ebin/ directory. This requires a lot more work that just exiting and entering the Erlang terminal.
I have heard of makefiles, but I don't know if they can be ran from within an Erlang terminal.
The reason I don't want to exit the terminal is because I will lose my history of previous commands. If I'm using modules:methods with long names this takes a lot of typing time for each change made.
Is there any method to reload the .beam files in the current directory while in an Erlang terminal? Or is there any way to load the previous command history of the Erlang terminal?
You can use the l(Module). command in the shell which loads, or reloads, a module from the current directory into Erlang.
I would suggest something like active or sync but straightforward approach with c/1, l/1 and nl/1 works too
[edited]
Run your application from eclipse and check the node name, the default is #. Shut that down.
Start a separate erlang node with the same name. Now when running the application from eclipse that node will get used and you can use the shell in the terminal, while erlide will be able to reload beam code automatically when saving files.

Run, The Command Line and that Path Variable

I'm having a very weird issue with the command line and running Ant. I point the path variable at the location of my Ant bin directory (C:\Ant\bin) and when i go into a command window and type PATH it shows the location in it. But when I go to run Ant by typing "ant" it does nothing and states that it isn't recognized. But when I go to the run window (Windows+R) and type "ant" it runs it.
I have restarted Windows twice and the problem still persists. I am running Windows Vista Ultimate with SP1 installed. I have tried "Running as Administrator" with no difference.
Any one experience anything like this before?
Sometimes you can set a system-wide (or even just personal) Environment Variable and it'll cure it, as opposed to just setting it in your shell.
Go to the Control-panel, then System, then Advanced, and look for the button on Environment Variables. From there, you can follow your nose.
Good luck.
Ant also depends on Java to be on the path. Do you have that?
I would also check to make sure the environment variables ANT_HOME and JAVA_HOME are set up properly in the console.
Is there any chance that the command window you are trying to run Ant in is a different window to the cmd windwo where you set up and verify that its in the path? If the PATH is updated after a cmd window is already open it won't recongnise the change. Not clear if that might be your issue.
If you are in the dir C:\Ant\bin and type "ant" does it recognise it?