I have a project which includes a number of test cases and I compile it using the Maven surefire plugin 2.13. When I set the forkmode = none everything works fine,but when I omit that entry, the default forkmode become once and my project fails:
Forking command line: cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_37\jre\bin\java" -jar G:\Gottware-server\core\math\target\surefire\surefirebooter
7758025909061587587.jar G:\Gottware-server\core\math\target\surefire\surefire8735550212668630533tmp G:\Gottware-server\core\math\target\surefire\suref
ire_08386349728753606434tmp"
The system cannot find the path specified.
It looks like it's an OS problem, I am using Windows 7. What can be going wrong? IT's curious that also after succesfull builds I get the same error:
[INFO] -----------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------
[INFO] Total time: 15.504s
[INFO] Finished at: Fri Mar 08 15:08:54 CET 2013
[INFO] Final Memory: 13M/353M
[INFO] -----------------------------------------------
The system cannot find the path specified.
In fact I have debugged my last line of my maven of the mvn.bat
cmd /C exit /B %ERROR_CODE%
and this simply does not work anymore returning:
The system cannot find the path specified.
I further went down in debuggining:
U:\>cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
The system cannot find the path specified.
In the line you pasted, I see a doubled double-quote:
Forking command line: cmd.exe /X /C ""C:\Program
^^^^
Maybe you've set a bad value for JAVA_HOME (or some other place where you've defined the Java path). This would also explain why it doesn't fail on other systems: you've got a different (and correct) JAVA_HOME there.
The surefire plugin doesn't always report friendly errors. Couple of things I can think to check:
How much disk space is available in G:\Gottware-server\...? Could you be bumping up against a disk quota (on a NAS share) or is your laptop drive full?
Check where the local artifact repository is located too. Have you hit a quota/run out of room there?
How much memory is available on the build machine? Do you have enough memory available to run the tests in a separate JVM, and if yes, is the JVM configured to have enough memory? You may try using the <argLine> property to configure memory settings for the forked VM. (I've also helped someone who had huge memory settings in <argLine>, more than was available on their machine when running Eclipse, and multiple browser windows, etc. In that case lowering the memory settings for the forked JVM solved the problem.)
I had the same error, and it was there becase I had a bat file launched automatically when cmd launched (and I guess some linked paths issues).
I will quote this answer to explain my solution: https://superuser.com/questions/144347/is-there-windows-equivalent-to-the-bashrc-file-in-linux#answer-916478
My script was called bashrc.bat, which I placed under my %USERPROFILE% folder.
In registry editor (regedit) I located the following entry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
And then added a key called Autorun with value %USERPROFILE%\bashrc.bat
When I removed this key from registry, after launching cmd again, the line The system cannot find the path specified. was not displayed anymore and surefire could resume its activities.
Related
I am running OS X Mavericks on a MacBook Pro.
I have maven 3.0.5 installed.
When I run mvn, I am getting the following error message.
Error while executing process. Cannot run program "/bin/sh": error-2, No such file or directory
And before you ask:
PATH="/usr/local/apache-maven-3.0.5/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin:/usr/local/bin:/bin:/usr/bin"
M2_HOME="/usr/local/apache-maven-3.0.5"
M2="/usr/local/apache-maven-3.0.5/bin"
MAVEN_OPTS="-Xms256m -Xmx768m -XX:MaxPermSize=512m"
I am also seeing the following near the beginning of the mvn output:
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Failed to use environment variables for interpolation: Cannot run program "env": error=0, spawn failed #
I had the same problem: exec() failed with ANY executable. Finally remembered that I was using a private jre. That jre was a copy of the original one, just with bin/java set as executable.
I made lib/jspawnhelper executable and it worked!
If you are using eclipse , this is due to the java version. point java to your OS java instead of eclipse java. this will be solved
It seems your system is missing the "sh" shell to start interpreting the script.
I just looked up installed shells on Mac OSX and got this result:
/bin/zsh
/bin/ksh
/bin/tcsh
/bin/bash
/bin/sh
So when "/bin/sh" is missing, try "/bin/bash" for example.
Better:
Check if "/bin/sh" exist
If exist check if the user which runs the command can execute the shell
Because it can be possible that the shell binary exist but isn't executable for you. Then you have to make it executable for the user trying mvn.
Hope that helps ;)
I've been building PhoneGap apps for BlackBerry for about a year now. Suddenly, the build process is hitting errors like this:
build:
[exec] [INFO] Parsing command line options
[exec] [INFO] Parsing bbwp.properties
[exec] [INFO] Validating application archive
[exec] [INFO] Parsing config.xml
[exec] [WARNING] Failed to find the <author> element
[exec] [INFO] Populating application source
[exec] [INFO] Compiling BlackBerry WebWorks applicatio
n
[exec] I/O Error: Cannot run program "C:\Program": CreateProcess error=2, T
he system cannot find the file specified
[exec] [ERROR] RAPC exception occurred
I suspect this may have something to do with a recent Java update (Java 7 maybe?)
I've tried the old DOS 8.3 trick of using PROGRA~1 instead of Program Files in the bbwp.properties and project.properties files. None of that seems to help.
Any ideas where else the problem might reside?
I've seen a few other people out on the Internet asking the same question, so I'll post my solution here in case it helps those who hit the problem in the future.
The root of the problem seems to be related to the upgrade to Java 7. The combination of it and Apache Ant get hung up on file paths with spaces. After hours of tinkering, the best solution was to reinstall Java, Apache Ant, WebWorks and PhoneGap. Each were placed in a folder off the root of the C:\ drive with no spaces in the filenames.
C:
├ \ant
├ \java
├ \phonegap
└ \webworks
Once I had this org structure, and reset all of the environment variables (PATH, JAVA_HOME, ANT_HOME, etc.) the builds all started working again. Just make sure you update your project.properties file in your project folder.
Update:
It may also be helpful to use the DOS Where command to see where Java resides on your hard drive.
> where java
In my case, the JAVA_HOME path pointed to Java 1.6, but a check of the Java version from the command line (java -version) showed that Java 1.7 was being run. The reason was that Java.exe had been installed in my C:\Windows\System32 folder (why?), and since that folder is the first entry in my PATH variable, that version of java.exe is what gets run. Always.
Bottom line: Use the DOS Where command to ensure the version of java being run by ANT is really the version you think it is.
The problem is that Webworks installer copies the JAVA PATH to a couple of files:
installvariables.properties (<java>XXXXXXXXXXX</java>)
bin\bbwp.properties (Java_Home=XXXXXXXXXXXX)
That leads to errors when compiling, even if you have changed your PATH variables and JAVA instalation.
Change the value to the correct path in these files to solve the problem.
Is recommendable to install all this stuff in non-whitespace paths because that could lead to other compiling problems.
I'm going through jenkins-the-definitive-guide. I have installed Jenkins on Windows 7 64 bit using the windows installer. I've configured a build and setup Jenkins to auto-install JDK 7u3 on the first build. When the build kicks off I see this in the console logs:
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\gameoflife-default
Installing C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe
[JDK_7u3] $ "C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe" /s /v /qn /L '\"C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe.install.log\"' REBOOT=ReallySuppress 'INSTALLDIR=\"C:\Program Files (x86)\Jenkins\tools\JDK_7u3\"'
It never progresses beyond this.
I've tried:
- ensuring the exe is not blocked
- ensuring the service account has admin privileges
- tried installing other JDKs.
Any thoughts?
There is an error in the JDK auto-installation for JDK7, it seems:
https://issues.jenkins-ci.org/browse/JENKINS-5408
If you try running that command on the command line, you get the msiexec dialog box, which implies that a parameter is incorrect. Since I am also having this issue, I went and looked at what Jenkins actually passes. It does (in our case):
c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\"
The escaped quotes are a holdover from old-style msiexec installations, where everything after the /v had to be in single quotes because it was all getting passed through to something else. The single quote escapes were removed, but the actual syntax isn't correct any more either (the installer has changed, as have the options). The issue is the quote escaping being done in the INSTALLDIR variable. If you remove that, it will sort-of-install (you may still have an msiexec process hanging). Example:
c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\"
You might be able to go even further and use /norestart rather than setting the reboot property, depending on whether or not it's respected.
All these suggestions I'm making still don't get to the actual problem, which is 'how to auto-install JDK7 correctly'. If you're having this problem, I don't know that you can without finishing the installation manually and then turning off auto-install in the main config. For me, cleaning the cache files didn't seem to help.
I am running a Maven2 compile of a large Java project on a linux virtual machine
Compilation is failing with the following error "compiled with -X for debugging"
[DEBUG] Source roots:
[DEBUG] /home/{...}/src/main/java
[DEBUG] /home/{...}/target/generated-sources/meta
[INFO] Compiling 1377 source files to /home/{...}
Killed
(and I go back to bash prompt immediately)
I figure this could be:
A linux thing (I checked that my ulimit -Hn is okay, 10000)
A VM thing (this in on an amazon EC2 ubuntu instance)
A maven / java thing (Never seen this kind of death, usually just out of memory errors and the like)
Any thoughts to narrow down the culprit?
My first guess would be that you're running out of memory, and the kernel is killing the compile process.
I would start by looking to see if there are other resource limits; e.g. run ulimit -a.
I am trying to run a program which is executed by running the following batch file:
#echo off
rem Add extra JVM options here
set OPTS=-Xms64m -Xmx256m
rem Build command line arguments
set CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setupArgs
:doneStart
rem Launch the DCS
java %OPTS% -Djava.ext.dirs=lib -Ddcs.war=war/carrot2-dcs.war org.carrot2.dcs.DcsApp
%CMD_LINE_ARGS%
This batch file sets up the program at http://localhost:8080 (I believe it's a servlet). The program is a cluster engine similar to the one here: http://search.carrot2.org/stable/search. Everything seems to work, but I get the following command prompt output from executing the batch file.
[INFO] Starting DCS...
[INFO] Native LAPACK not available: no nni_lapack in java.library.path
[INFO] Native BLAS not available: no nni_blas in java.library.path
[INFO] DCS started on port: 8080
I managed to find the LAPACK and BLAS libraries online, but how do I add them to java.library.path (and how do I find what java.library.path points to)?
If anyone who'd like to help me needs some additional information or clarification, please let me know. I'm pretty new to java web development.
java.library.path is used by Java to find native libraries (dlls on Windows). You need to download LAPACK and BLAS libraries somewhere (e.g. in C:\path\lapack\lib and C:\path\blas\lib). You then need to set java.library.path appropriately when you call your program. For example:
java %OPTS% -Djava.library.path=C:\path\lapack\lib;C:\path\blas\lib -Djava.ext.dirs=lib -Ddcs.war=war/carrot2-dcs.war org.carrot2.dcs.DcsApp
You can try:
SET PATH=<path>/lapack.dll;<path>/blas.dll