java - Random "No compiler provided" error Maven -


i try build project using maven. , everytime can have accidentally received error

no compiler provided in environment. perhaps running on jre rather jdk? 

and can run build again , ok.

    java_home c:\program files\java\jre1.8.0_40 m2_home c:\program files\maven  d:\java_projects>mvn -version apache maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11t23:58:10+03:00) maven home: c:\program files\maven java version: 1.8.0_40, vendor: oracle corporation java home: c:\program files\java\jre1.8.0_40 default locale: en_us, platform encoding: cp1251 os name: "windows 7", version: "6.1", arch: "amd64", family: "dos" d:\java_projects> 

pom.xml:

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelversion>4.0.0</modelversion>     <groupid>com.epam</groupid>     <artifactid>news</artifactid>     <version>0.0.2-snapshot</version>     <packaging>jar</packaging>      <properties>         <jdk.version>1.8</jdk.version>         <spring.version>4.1.5.release</spring.version>         <jstl.version>1.2</jstl.version>         <junit.version>4.12</junit.version>         <tiles.version>3.0.5</tiles.version>     </properties>      <build>         <plugins>             <plugin>                 <artifactid>maven-compiler-plugin</artifactid>                 <version>3.1</version>                 <configuration>                     <source>${jdk.version}</source>                     <target>${jdk.version}</target>                 </configuration>             </plugin>              <plugin>                 <artifactid>maven-assembly-plugin</artifactid>                 <executions>                     <execution>                         <phase>package</phase>                         <goals>                             <goal>single</goal>                         </goals>                     </execution>                 </executions>                 <configuration>                     <descriptorrefs>                         <descriptorref>jar-with-dependencies</descriptorref>                     </descriptorrefs>                 </configuration>             </plugin>         </plugins>     </build>     <dependencies>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-context</artifactid>             <version>${spring.version}</version>             <scope>compile</scope>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-test</artifactid>             <version>${spring.version}</version>             <scope>test</scope>         </dependency>          <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-beans</artifactid>             <version>${spring.version}</version>             <scope>compile</scope>         </dependency>          <dependency>             <groupid>org.mockito</groupid>             <artifactid>mockito-all</artifactid>             <version>1.9.5</version>             <scope>test</scope>         </dependency>         <dependency>             <groupid>org.unitils</groupid>             <artifactid>unitils-dbunit</artifactid>             <version>3.4.2</version>             <scope>test</scope>         </dependency>         <dependency>             <groupid>com.github.springtestdbunit</groupid>             <artifactid>spring-test-dbunit</artifactid>             <version>1.2.1</version>             <scope>test</scope>         </dependency>         <dependency>             <groupid>log4j</groupid>             <artifactid>log4j</artifactid>             <version>1.2.17</version>             <scope>compile</scope>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-tx</artifactid>             <version>${spring.version}</version>         </dependency>         <dependency>             <groupid>org.springframework</groupid>             <artifactid>spring-jdbc</artifactid>             <version>${spring.version}</version>         </dependency>         <dependency>             <groupid>com.oracle</groupid>             <artifactid>ojdbc6</artifactid>             <version>11.2.0</version>             <scope>compile</scope>         </dependency>     </dependencies> </project> 

i have error in 90% of using cmd(mvn package) , 40% of using eclipse (maven build)

solved:

download latest jdk, update java_home, update window->preferences->java->installed jres

you running on jre error says , choose jdk path.

window->preferences->java->installed jres->jre1.8.0_40

you should have entry jdk there. if not point jdk.

then,

rightclick project -> maven -> update project


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -