Announcement Announcement Module
Collapse
No announcement yet.
Got error "Cannot run program "mvn.bat", how to resolve? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Got error "Cannot run program "mvn.bat", how to resolve?

    Hello, dear all

    I am new to Spring ROO, today I just downloaded springsource-tool-suite-2.3.3.M2-e3.5.2-win32.zip, and try to use it to create the Spring Roo project in my winxp machine.

    While I got below error when I perform "perform tests", "perform eclipse", etc.
    How to resolve this problem? Thanks a lot.
    -------------
    Cannot run program "mvn.bat" (in directory "D:\opensource\Spring\springsource\sts-2.3.3.M2\workspace-sts-2.3.3.M2\TestDemo"): CreateProcess error=2, The system cannot find the file specified
    -------------

    The STS.ini contains:
    ==============
    ......
    --launcher.XXMaxPermSize
    256M
    -vm
    C:\Java\jdk1.6.0_20\bin\javaw.exe
    -vmargs
    ......
    ==============


    The command I ran is as below:
    -------
    roo> persistence setup --provider HIBERNATE --database MYSQL
    Managed SRC_MAIN_RESOURCES\META-INF\spring\applicationContext.xml
    Created SRC_MAIN_RESOURCES\META-INF\persistence.xml
    Please enter your database details in src/main/resources/META-INF/spring/database.properties.
    Created SRC_MAIN_RESOURCES\META-INF\spring\database.properties
    Managed ROOT\pom.xml [Added dependency mysql:mysql-connector-java:5.1.13]
    Managed ROOT\pom.xml [Added dependency org.hibernate:hibernate-core:3.5.1-Final]
    Managed ROOT\pom.xml [Added dependency org.hibernate:hibernate-entitymanager:3.5.1-Final]
    Managed ROOT\pom.xml [Added dependency org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final]
    Managed ROOT\pom.xml [Added dependency org.hibernate:hibernate-validator:4.0.2.GA]
    Managed ROOT\pom.xml [Added dependency javax.validation:validation-api:1.0.0.GA]
    Managed ROOT\pom.xml [Added dependency cglib:cglib-nodep:2.2]
    Managed ROOT\pom.xml [Added dependency javax.transaction:jta:1.1]
    Managed ROOT\pom.xml [Added dependency org.springframework:spring-jdbc:${spring.version}]
    Managed ROOT\pom.xml [Added dependency org.springframework:spring-orm:${spring.version}]
    Managed ROOT\pom.xml [Added dependency commons-pool:commons-pool:1.5.4]
    Managed ROOT\pom.xml [Added dependency commons-dbcp:commons-dbcp:1.3]
    Managed ROOT\pom.xml
    roo> database properties set --key database.url --value jdbc:mysql://localhost/forecasting?useUnicode=true&characterEncoding= UTF-8
    Managed SRC_MAIN_RESOURCES\META-INF\spring\database.properties
    roo> entity --class ~.domain.Rawdata --testAutomatically
    Created SRC_MAIN_JAVA\forecast\sys\data\domain
    Created SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata.jav a
    Created SRC_TEST_JAVA\forecast\sys\data\domain
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand.java
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataInte grationTest.java
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataInte grationTest_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _Entity.aj
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_DataOnDemand.aj
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataInte grationTest_Roo_IntegrationTest.aj
    Created SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_Configurable.aj
    Created SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _ToString.aj
    Created SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _Configurable.aj
    ~.domain.Rawdata roo> field string --fieldName name --notNull --sizeMin 1 --sizeMax 30
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata.jav a
    Created SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _JavaBean.aj
    Managed SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_DataOnDemand.aj
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _ToString.aj
    ~.domain.Rawdata roo> field string --fieldName datatime --notNull --sizeMin 1 --sizeMax 20
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata.jav a
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _JavaBean.aj
    Managed SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_DataOnDemand.aj
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _ToString.aj
    ~.domain.Rawdata roo> field string --fieldName area --notNull --sizeMin 1 --sizeMax 20
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata.jav a
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _JavaBean.aj
    Managed SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_DataOnDemand.aj
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _ToString.aj
    ~.domain.Rawdata roo> field string --fieldName price --notNull --sizeMin 1 --sizeMax 20
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata.jav a
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _JavaBean.aj
    Managed SRC_TEST_JAVA\forecast\sys\data\domain\RawdataData OnDemand_Roo_DataOnDemand.aj
    Managed SRC_MAIN_JAVA\forecast\sys\data\domain\Rawdata_Roo _ToString.aj
    ~.domain.Rawdata roo> test integration
    ~.domain.Rawdata roo> perform tests
    Cannot run program "mvn.bat" (in directory "D:\opensource\Spring\springsource\sts-2.3.3.M2\workspace-sts-2.3.3.M2\TestDemo"): CreateProcess error=2, The system cannot find the file specified
    ~.domain.Rawdata roo> perform eclipse
    Cannot run program "mvn.bat" (in directory "D:\opensource\Spring\springsource\sts-2.3.3.M2\workspace-sts-2.3.3.M2\TestDemo"): CreateProcess error=2, The system cannot find the file specified
    ~.domain.Rawdata roo>
    -------

  • #2
    Check if the path env contains the directory of your mvn installation.


    I have Ubuntu and this was the way I managed to get it work. I created a soft link to mvn.

    HACK
    Try creating a batch file named mvn.bat in D:\opensource\Spring\springsource\sts-2.3.3.M2\workspace-sts-2.3.3.M2\TestDemo that calls the real mvn.bat.

    Comment


    • #3
      Originally posted by RL1234 View Post
      Check if the path env contains the directory of your mvn installation.


      I have Ubuntu and this was the way I managed to get it work. I created a soft link to mvn.

      HACK
      Try creating a batch file named mvn.bat in D:\opensource\Spring\springsource\sts-2.3.3.M2\workspace-sts-2.3.3.M2\TestDemo that calls the real mvn.bat.
      Thank you! This resolved my problem!

      Comment


      • #4
        I got the same error too, when running "perform tests" in the Roo shell within STS.

        Tried to use the workaround by creating the mvn.bat but still getting the same message.

        Code:
        Cannot run program "mvn.bat" (in directory "C:\Users\shri\Documents\workspace-sts-2.5.0.M3\core"): CreateProcess error=2, The system cannot find the file specified
        Using STS 2.5.0.M3, maven 2.2.1 release and java jdk 1.6.0_21

        OS is Windows 7, 64-bit
        Last edited by Shriblue; Sep 14th, 2010, 03:26 PM. Reason: added environment details

        Comment


        • #5
          Originally posted by Shriblue View Post
          I got the same error too, when running "perform tests" in the Roo shell within STS.

          Tried to use the workaround by creating the mvn.bat but still getting the same message.

          Code:
          Cannot run program "mvn.bat" (in directory "C:\Users\shri\Documents\workspace-sts-2.5.0.M3\core"): CreateProcess error=2, The system cannot find the file specified
          Using STS 2.5.0.M3, maven 2.2.1 release and java jdk 1.6.0_21

          OS is Windows 7, 64-bit
          my workaround solutions

          set env to maven home
          set STS==>preference==>maven==>Installations to maven home
          run STS in this env

          Comment


          • #6
            I just spoke with the STS lead and we can intercept the "perform" commands so these are performed via m2eclipse. It's not going to be feasible to modify the path to include mvn automatically as part of the STS installer. As such would you please log a ticket at https://jira.springsource.org/browse/ROO for us to add a strategy interface for STS command execution.

            Thanks
            Ben

            Comment


            • #7
              Originally posted by Ben Alex View Post
              I just spoke with the STS lead and we can intercept the "perform" commands so these are performed via m2eclipse. It's not going to be feasible to modify the path to include mvn automatically as part of the STS installer. As such would you please log a ticket at https://jira.springsource.org/browse/ROO for us to add a strategy interface for STS command execution.

              Thanks
              Ben
              Done. https://jira.springsource.org/browse/ROO-1663

              Comment


              • #8
                Thank you, Alex. I've voted for this and looking forward to its release.

                Comment


                • #9
                  Make sure you have set a JAVA_HOME environment variable with the value set to your Java SDK base directory e.g. C:\Program Files\Java\jdk1.6.0_24. This is required for maven.

                  Comment

                  Working...
                  X