I'm using Spring Roo in STS and when I run the command "perform tests" I get the following error:
Cannot run program "mvn.bat" (in directory "C:\SS workspace\hello"): CreateProcess error=2, The system cannot find the file specified
Does anyone know what's the problem? I have maven installed properly and the PATH env set to MAVEN_HOME/bin
My Guess is that it chokes on the whitespace character in the current directory (although it shouldn't)
Known bug. Instead use the 'Run As > JUnit Test' command
STS provides via the 'Run As > JUnit Test' a more visual interface
which I prefer, but some may still prefer the "Roo Shell"
If you are on windows 7- 64 bit machine, check if your mavan is on path. Omit MAVAN_HOME and try adding full path.
Related
Newby Maven question...
I am trying to run some tests in a Java Test Automation Framework.
This commmand works fine in linux:
mvn test -Denv.file=src/test/resources/env/.env
However, when I try to run it in Windows I get this error:
Unknown lifecycle phase ".file=src/test/resources/env/.env". You must specify a valid lifecycle phase or a goal in the format
I am presuming that -Denv.file works on Linux but you need a different command on Windows?
I've tried googling but can't find anything.
Add plugin and run the spring boot application
Yes, it is possible.
Install Apache maven in your system. Make sure that the path/maven/bin directory is available in your system's PATH environment variable.
open terminal inside vs code(press Ctrl + `)
Execute the following command : I used bash terminal for it
./mvnw spring-boot:run
The #Vikey solution does note feature debugging, I think. You you should use an integrated solution, like an extension:
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-spring-boot-dashboard
I am trying to run gradle command from groovy script.
File : file.groovy
def command = "gradle clean"
command.execute()
Getting following error,
$ groovy file.groovy
Caught: java.io.IOException: Cannot run program "gradle": CreateProcess
error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "gradle": CreateProcess error=2, The
system cannot find the file specified
at file.run(file.groovy:2)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot
find the file specified
... 1 more
Same file is running perfectly fine on MAC.
Using Gradle 3.0 and Groovy 2.4.7
Also if running gradle clean directly, it is working as expected.
Issues comes only when calling from groovy file on windows system.
Tried on windows cmd as well as cygwin. Same issue.
Tried on windows cmd as well as cygwin. Same issue.
I'd say you have a problem with gradle installation. Just follow instructions
https://docs.gradle.org/current/userguide/installation.html
And pay attention to this point:
3.4. Environment variables
For running Gradle, firstly add the environment variable GRADLE_HOME.
This should point to the unpacked files from the Gradle website. Next
add GRADLE_HOME/bin to your PATH environment variable. Usually, this
is sufficient to run Gradle.
I'm new to Gradle and while trying to install Gradle in my PC with Windows OS, I got the below mentioned error
Error: Could not find or load main class org.gradle.launcher.GradleMain
Only thing I did is that I followed the gradle installation steps given in gradle site Gradle installation and typed
gradle -v
in command prompt and I got the above mentioned exception. Any clue as to what had happened and how to resolve it.
This is what I have done :
Downloaded the zip file
Copied 'gradle-3.5' from the zip file to a folder I created in C drive (C:\Gradle)
Set GRADLE_HOME to 'C:\Gradle\gradle-3.5'
Set Path to '%GRADLE_HOME%\bin'
Opened cmd and typed gradle -v and got this error
I stopped all gradle daemons by running ./gradlew --stop and the error was resolved for me.
Basically this means that Gradle can't find your gradle/wrapper/gradle-wrapper.jar.
You have to follow Step 3 and setup environment variables:
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer) icon, then
click Properties -> Advanced System Settings -> Environmental
Variables.
Under System Variables select Path, then click Edit. Add an entry for
C:\Gradle\gradle-3.5\bin. Click OK to save.
Source: https://gradle.org/install#configure
The easiest way, is to simply use gradlew.bat in your project and it will auto download Gradle for you!
I had the same issue after I removed the cache, the Gradle worker was running and I was getting this error
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Steps I performed to resolve the error
Use gradle --stop or ./gradlew --stop
Delete the workerMain.lock file under $USER/.gradle/caches/version/workerMain
re-run the Gradle command
I have a strange situation on which I cannot get phantom tests to run from intellij.
java.io.IOException: The phantomjs executable cannot be launched from the path or from the value of the org.codehaus.jstestrunner.commandPattern property.See http://js-testrunner.codehaus.org/usage.html for instructions. Original exception: java.io.IOException: Cannot run program "phantomjs": error=2, No such file or directory
Now, I have no idea why this is because:
I can access phantom from the command line, as 'mvn test' works, runs and passes the tests
I have added it as a path variable
I have added it as a path variable that is accessible by a GUI program
I've check the permissions on the phantomjs file and they're as permissive as I can make them - they are permissive than the actual IntelliJ application, and 'owned' by the same owner / group
I have restarted my Mac / IntelliJ numerous times.
I have tried adding it as a 'VM' option for a 'mvn install' task:
mvn test -Dorg.codehaus.jstestrunner.commandPattern="/usr/local/bin/phantomjs '%1$s' %2$s"
Can anyone think why the jstestrunner action that occurs as part of the mvn test target does not seem able to access / see my phantom installation
First thing to check: did you try to hardcode in your pom.xml the full path to the PhantomJS executable?
I know it's not the "final" solution, but it's to make sure it works if you pass it the full-qualified-path.