3

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.
Edmondo
  • 19,559
  • 13
  • 62
  • 115
  • The problem does not look like to do with maven, but rather with my computer settings... – Edmondo Mar 13 '13 at 17:08
  • U:\>cmd.exe Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. The system cannot find the path specified. – Edmondo Mar 14 '13 at 17:57

3 Answers3

2

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.

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99
  • my java home is correct, it looks like maven is surrounding that with double brackets – Edmondo Mar 08 '13 at 16:09
  • 1
    I am also using Windows 7, surefire plugin with forkmode "once" and see that same statement in the logs: `Forking command line: cmd.exe /X /C ""c:\Program Files\Java...` . It's working fine for me. – user944849 Mar 09 '13 at 03:44
  • It looks like the problem is with cmd /C exit /B 0 – Edmondo Mar 11 '13 at 08:10
1

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.)
user944849
  • 14,524
  • 2
  • 61
  • 83
  • all working. It looks like the problem is with my machine setup: Running cmd /C exit /B %ERROR_CODE% does not work ! – Edmondo Mar 09 '13 at 12:26
0

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.

  • Please redo this with actual code and not only the link (you can keep the link) and this is an acceptable answer. We don't want that site to eventually not be available and the answer is lost. Better is to include the relevant part of the other page. Best is to provide a correction to the posted code using the relevant part of the other page. Answer standards here -> https://stackoverflow.com/help/how-to-answer – Rodger Dec 10 '19 at 02:23