I am executing ant build from Linux machine. The whole works fine in Windows.
But in Linux, the values from property files are not getting loaded.
I am using the command ant -Dpropertyfile=configurable.properties build and also using
property file = "build.properties"
It doesn't return any values.
Also, is there any difference in executing ant build from Windows and Linux ?
Please provide your suggestion.
The Ant command line option to load a Properties file is -propertyfile. There is no -D before it nor an equals sign after it:
ant -propertyfile configurable.properties
The Ant command line option for loading the properties is -propertyfile <.properties> is for linux. There is no need for a equals or -D.
Related
My bash file is running fine in windows but it is not working in linux/mac.
I have created a selenium project with testng and I want to create a bash file so I can run my project without IDE
I have searched but till not getting any solution for same
Error on terminal:-
>bash TestNg_RunMe.bat
>Error: Could not find or load main class ..src.lib.selenium-java-2.46.0.jar
>TestNg_RunMe.bat: line 1: ./bin: Is a directory
Note:- I have use bash command also to run the command in linux and mac
Also lib and bin directory is present in right place(As it working fine in windows)
My bash file is :-
java -cp ./src/lib/*;./bin org.testng.TestNG testng.xml
Above bash is working perfect for windows
I have also tried with full absolute path
I have also extract testng.jar and add it in bash file
but nothing work.
Paths are separated using : under Unix-like systems and not ; as in Windows:
java -cp ./src/lib/*:./bin org.testng.TestNG testng.xml
If you are using bash under Windows then changing to : should work everywhere.
The ; character means end of statement to a Unix shell, so what you are attempting to exceute is:
java -cp ./src/lib/*
./bin org.testng.TestNG testng.xml
I have a script file that I was given to run in windows using Cygwin. When I try to use this file I get the following error
-bash: /sigdet/filename: cannot execute binary file: Exec format error.
sigdet is the folder within the Cygwin directory that I have the script. Rawdata is the name of the directory with the raw data files that the script is supposed to analyze.
To try and solve this, I have changed the file permissions, I have checked to make sure that it is on a 64 bit machine and the script appears to have compiled on a 64-bit machine. After these steps, I don't know what else the problem could be. Here are the commands I've entered:
I first changed the directory like so:
$ cd /sigdet/
Then I ran the script that is suppsed to work:
$ /sigdet/filename -i rawdata
Does the script file need to have an extension in windows? I've tried changing it to a .sh extension with no luck. I'm told that it just works on other windows machines just how it is.
Thanks to anyone that can help with this.
Your file is not an executable. It most probably contains ELF executable which is designed for Linux operating system, or it's corrupt.
If your file was a shell script, or in fact anything that contained plain text, you'd get different errors (such as, "expected command name" or "unknown command: XYZ" etc.)
Scripts are not supposed to have file extensions, like any executables. On the other hand, they should have shebangs: small text located in the first line that tells the system the path to the interpreter. For example, a Python executable script might be named whatever and have #!/usr/bin/python3 or similar in the first line. When you run it through ./whatever in the shell, it'll look for python3 in /usr/bin and run your file like this: /usr/bin/python3 ./whatever. (In fact, thanks to this you can also specify additional parameters that get passed to the interpreter.)
There is also a chance that your script is valid, but it contains a shebang pointing to bad interpreter. If that is the case, then most likely the path is correct, otherwise you'd get /whatever/interpreter: bad interpreter: no such file or directory error or similar. But then, all the other points apply to the interpreter (which is just another executable...)
If the script and/or interpreter was meant to be executed on Windows or Cygwin at least, it should either contain aforementioned shebang (#!/path in the first name) or it should be Windows executable (in which case the file data should begin with MZ letters, you can inspect it in notepad.) If it isn't, it means the files you were given can't run on Cygwin.
Had this same problem. Added the following at the top of makefile:
export ARCH = CYGNUS
What happened during the make process is that Linux and Windows versions of the executables were created. You just have to use ./.exe versions.
In my case, I got the error when I used a wrong command to compile my C program. When I used the right command:
gcc myprog.c -o myprog.exe
the error was resolved.
I recently installed Cygwin on Windows 8.1, it works great but I can't execute file using the dot, for example "./hello.ml". I'm using the Windows's command prompt.
When I try using it, it show me that "." is not reconized. How can I make it works ?
Thanks.
You need to use the cygwin terminal or powershell instead.
The command interpreter doesn't think that your files are executable because they aren't one of the types that are recognized as binary executables. In general, Windows would use file associations from the registry to make things happen when you try to run a file. The cygwin terminal follows the unix-like convention and knows that your scripts are ml files and they are executable by using the ml interpreter, most likely from a #! at the top of your file.
How can I have the pre-build step in eclipse/CDT (Linux) run a simple shell command, echo specifically. I think eclipse has a screwed up value for PKG_CONFIG_PATH and want to see what Linux thinks the value is.
Under the covers, Eclipse uses "make". You can simly edit the project's makefile:
help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/concepts/cdt_c_makefile.htm
You can also create an:
"External Tool", which is up there beside the Debug and Run buttons in
the toolbar. Then I tell the external tool to run the shell with the
configure script and any of it's arguments as arguments to the tool.
http://www.eclipse.org/forums/index.php/t/61866/
When you run any rake task with cucumber installed on a machine that doesn't have ANSICON installed, you get the following message:
*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows
When running locally I like using ANSICON, but when used within the build server I don't care about that - and I don't want to see that warning there. Is there a way to get rid of it?
You can actually remove the warning itself. I do not like installing a bunch of garbage just for the sake of having a green word. So, to remove the warning:
1. Locate the Cucumber installation in gems directory (it's in the Ruby installation directory). For me it was: lib\ruby\gems\1.9.1\gems\cucumber-1.2.0
2. In the cucumber-1.2.0\lib\cucumber\formatter directory of the Cucumber installation find the file ansicolor.rb
3. Locate the line:
STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}
and add # in front of it to comment it out:
# STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}
The line number was 14 for my version of Cucumber.
4. Save the file and you're done
Download and unzip the file from http://adoxa.altervista.org/ansicon/
open cmd and navigate to the unzipped folder
Navigate to x64 (if you have a 64 bit machine) otherwise navigate to x86
Type ansicon.exe -h and you will get help of this command
Execute 'ansicon.exe -i' to install and add ansicon to your Windows
Run your cucumber 0.10.0 test and you should
get the coloured output result on Windows
Can you add an exception to you spec_helper.rb? Or perhaps try adding a tag which you filter on when using rake?