eclipse sees make but says it does not - eclipse

I'm very confused about the error message I get. If I change the path to look for make in "C:\cygwin6400\bin" ( intentional forcing an error ) I get
Cannot run program "make": The system cannot find the file specified.
Error: Program "make" not found in PATH
PATH=[C:\cygwin6400\bin;......
as I would expect, now if I fix my path to point to "C:\cygwin64\bin" I get
"C:\cygwin64\bin\make.exe" all
Cannot run program "C:\cygwin64\bin\make.exe": The system cannot find the file specified.
So what does this error mean then because its not the same error about a missing make file path.
I know its not a path issue as I can run make from a cmd prompt at any location and it runs the make in my cygwin64\bin dir. So my only guess is it cant find something other then make.exe.

edit the path enviroment variable in your Mycomputer properties and append this line with a semi colon as value for the variable 'path'
variable Name: path
variable value: C:\cygwin64\bin;
open a new cmd window and type make, so that you can run make utility.if you run this utility successfully, eclipse ide will recognize the make utility.

Related

Matlab doesn't recognize user environmental variable

I installed an application named lqns in the path: /home/robb/Research/dist/lqns-6.2/lqns (lqns is a folder containing the executable lqns). I want the program to be executed in command line simply calling lqns in the shell, I solved this adding to the file ~/.bashrc the line:
export PATH=$PATH:/home/robb/Research/dist/lqns-6.2/lqns
And it works with no issue. I am now trying to execute this program inside a Matlab script, running:
[status, ~] = system("lqns " + filename, '-echo');
Where filename is the path of an input file. I get the error message:
/bin/bash: line 1: lqns: command not found
Running the exact same command with the shell I get no error: the program runs with no problem generating the relative output.
Running getenv('PATH'); in Matlab and printenv PATH on my OS shell I indeed get two different results: Matlab does't have the path to lqns. I even tried editing manually the files /etc/environment, /etc/bash.bashrc and /root/.bashrc, with no result. How can I solve this issue?
you need to launch matlab by typing matlab in a terminal, not by double clicking on its shortcut from your desktop. (or even typing ./matlab in a terminal from your desktop)
it's up to the operating system to determine what double clicking does, and it's not guaranteed to execute most of your shell initialization scripts (or even launch it from the correct shell to begin with).
more info at Why are environment variables not resolved when double-clicking .desktop file?

Mongod Command not recognized despite specifying Path

Im getting the following error;
'mongod' is not recognized as an internal or external command,
operable program or batch file.
I've googled/read various threads and incorrect path seems to be common root cause.
However I have specified what appears to be correct path (tried both with and without quotation marks as you can see) ;
You need to add the directories to the PATH variable. Click on the Path variable, then "Edit" and add 2 entries listed below. You then need to click "OK" twice for the changes to be fully saved.
%Mongo%
%Mongo2%
This references the two environment variables which you have created.
Notice: you may need to restart cmd before changes take effect.

Kafka error while running command to start zookeeper

I have kafka installed at following location
C:\Users\username\work\data\kafkadirectory\kafka\apache-kafka\kafka
Now, when I run following command at above location:
path/to/zookeeper-server-start.bat config\zookeeper.properties
I get error:
The input line is too long.
The syntax of the command is incorrect.
As can be seen, directory names don't include version(google search tells to get rid of version in directory names).
Still I face the issue.
Try the below-mentioned steps
Better to move the folder to short path 'C:\kafka\' (Reducing folder hierarchy)
Restart the command prompt to reset the classpath variable
Use PowerShell which have longer support to the classpath

PATH variable using eclipse differs from system variable

This little java code produces different output dependend on execution environment:
ProcessBuilder builder = new ProcessBuilder( "cmd", "/c", "set" );
builder.directory( new File("c:/") );
Process p = builder.start();
System.out.println(System.getenv("PATH"));
If executed on command promt it will state the full PATH variable which is also shown by navigating to Systenproperties->Environmentvariables (PATH) or using cmd, typing in set, and looking up for the PATH variable.
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Perforce;C:\Program Files\GnuWin32\bin;
If executed in eclipse it will also state the a PATH variable but it is not consitent with the one in the system itself.
Path=C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Perforce;C:\eclipse;
The issue is, i need to run an external application (openssl) in my java environment using a processbuilder. The path of that application is also stated in the Path variable. But this path is not available if the code is executed by using eclipse (which is a must in this case).
So i have absolutely no clue why this is the case and how to solve it.
I even tryed to stream the executing class to the hdd and try to execute that class using another processbuilder, but still the Path variable is not equal to the expected one (guess due to inheritance)
Please, if some of you guys have any clue how to get the same content of the Path variable using eclipse as the system itself does, point it out.
btw. Using a WINDOWS machine & using Kepler build

Calling a command line program

I have a executable that when double clicked opens in a command line window.
Now there is a input file (i.e named "sphere_15000.inp") in the same directory where the executable apame_win64.exe is located. So we can inter the file name in the command line.
The question is how this can be done from mathematica front end? With the RunThrough command I tried to do it with no avail.
RunThrough["Executable Location", "sphere_15000"]
Do I need to put this file location in my Windows 7 environment path variable? Hope for some suggestion in this regard.
UPDATE
Found a solution to my problem.
First set the Mathematica directory to the folder where the executable is located.
path="C:\Users\FlowCrusher\Desktop\CUSP solver\Apame_build_2011_01_09\solver";
SetDirectory[path];
Then use the following style of input.
Run["\"\"apame_win64.exe\" \"input\"\""]
Here "apame_win64.exe" is the executable one want to run and "input" is the input file for the executable. This solves the problem. But a new item in the wishlist.
Is there a way to hide the console window in the background?
Here is how it looks on my screen.
As Chris suggested if we use minimized console in the Run command we get a minimized window but the program does not execute.
I hope that a solution exists.
BR
Yes, you might put the folder of you executable into the Path variable, or provide the full path name.
However, RunThrough seems to have been superseeded (on Windows) by
Import["!command ","Text"], which will execute command and read the comaand line output into Matheamtica as a string.
E.g.:
Export["testit.txt", "bla", "Text"];
Import["!dir" <> " testit* > dir.log", "Text"];
FilePrint["dir.log"]
--
Otherwise, I also had good results in the past using NETLink (not sure if WScript.shell
still works on Windows7/8 or if one should use something else).
Emulating Run (RunThrough is not really needed I think):
Run2[cmd_String] := Module[{shell},
Switch[$OperatingSystem,
"Windows",
Needs["NETLink`"];
shell = NETLink`CreateCOMObject["WScript.shell"];
shell # run[cmd,0,True],
"Unix",
Run # cmd,
"MacOSX",
Run # cmd ] ];
Can you run your application with input from a basic command window instead of the application console? This might be the form of command you would need:
apame_win64 -input sphere_15000.inp
or simply
apame_win64 sphere_15000.inp
You can probably check the available switches by running apame_win64 -help
A multi-part command can be run from Mathematica, e.g.
Run["type c:\\temp\\test.txt"]
Alternatively, also returning output to the Mathematica session:
ReadList["!type c:\\temp\\test.txt", String]
I landed here wanting to run abaqus command line on windows.
The solutions provided here worked out for me (Windows 7, Mathematica 9):
SetDirectory#path;
Run["start /min abaqus job=" <> fileName <> " interactive ask_delete=OFF >> log.txt"]
(Here the abaqus option ask_delete=OFF overwrites an existing simulation results and the >> redirects all the output to a file)
I think, minimizing the window did not run in your case since the executable throws open that window. In that case, this might be of some help