Я загрузил пример Spring, который содержит модельный проект с этим файлом pom.xml:
Код: Выделить всё
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.packtpub.springmvc.chocolatestore.model
chocolatestore-model
jar
1.2
chocolatestore-model
1.7
UTF-8
UTF-8
4.0.1.RELEASE
4.2.2.Final
1.0.13
1.7.5
4.11
org.springframework
spring-context
${spring-framework.version}
org.springframework
spring-tx
${spring-framework.version}
org.slf4j
slf4j-api
${slf4j.version}
compile
ch.qos.logback
logback-classic
${logback.version}
runtime
org.hibernate
hibernate-core
${hibernate.version}
org.hibernate
hibernate-entitymanager
${hibernate.version}
cglib
cglib
dom4j
dom4j
org.hibernate.javax.persistence
hibernate-jpa-2.0-api
1.0.1.Final
commons-collections
commons-collections
3.2.1
org.hibernate
hibernate-validator
4.3.1.Final
javax.validation
validation-api
1.0.0.GA
javax.transaction
jta
1.1
org.springframework
spring-jdbc
${spring-framework.version}
org.springframework
spring-orm
${spring-framework.version}
commons-pool
commons-pool
1.5.6
commons-dbcp
commons-dbcp
1.4
commons-logging
commons-logging
xml-apis
xml-apis
org.hsqldb
hsqldb
2.2.9
org.springframework
spring-test
${spring-framework.version}
test
junit
junit
${junit.version}
test
org.apache.commons
commons-lang3
3.1
org.codehaus.jackson
jackson-mapper-asl
1.9.13
org.apache.maven.plugins
maven-compiler-plugin
2.5.1
${java.version}
${java.version}
${project.build.sourceEncoding}
org.apache.maven.plugins
maven-resources-plugin
2.6
${project.build.sourceEncoding}
org.apache.maven.plugins
maven-assembly-plugin
2.3
jar-with-dependencies
Код: Выделить всё
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building chocolatestore-model 1.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ chocolatestore-model ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ chocolatestore-model ---
[INFO] Compiling 15 source files to D:\Downloads\6539os-final-code-archive\chocolatestore-model\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.623 s
[INFO] Finished at: 2015-08-30T12:20:00+02:00
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project chocolatestore-model: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre1.8.0_25\..\lib\tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Не удалось выполнить цель org.apache.maven.plugins:maven-compiler-plugin:2.5.1:компилировать (компиляция по умолчанию) в проекте Chocolatestore-model: Неустранимая ошибка компиляции: Tools.jar не найден: C:\Program Files\Java\jre1.8.0_25..\lib\tools.jar -> [Справка 1]
Почему? Что именно означает эта ошибка? Что мне не хватает? Как я могу решить эту проблему?
В pom.xml имеется ссылка на версию Java 7 в этой строке:
Код: Выделить всё
1.7
Код: Выделить всё
C:\Users\Andrea>java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Подробнее здесь: https://stackoverflow.com/questions/322 ... mpile-goal
Мобильная версия