2014-09-06 5 views
0

Это ошибка, я получаю: Ошибка компиляции: JAVAC Класса не найдено: org.eclipse.jdt.core.JDTCompilerAdapterTeamCity не может найти JAVAC, пытаясь запустить сборки конфигурацию с муравьиным шагом сборки

Я пытаюсь запустить конфигурацию сборки с шагом сборки муравья и продолжать получать эту ошибку. Насколько я знаю, я правильно установил переменные среды, и я предполагаю, что TeamCity поставляется со всем необходимым для компиляции .java-файлов, почему он не может найти javac.exe?

Сообщите мне, какие детали я могу предоставить. Репозиторий можно найти здесь: https://code.google.com/p/ci-research-teamcity-test-project/source/browse

+0

бежит версию окна из TeamCity? Он поставляется в комплекте JRE **, а не ** JDK (исполняемый установщик Windows в комплекте с Tomcat и Java 1.7 JRE) – DavidPostill

+0

Да, я запускаю версию Windows 7.x Я думаю .. Как мне перейти на руководство TC к JDK тогда? Я уже сделал глобальный env. var называется JDK_HOME со значением пути JDK .. и я также попытался сделать это в конфигурации сборки. –

+0

http://confluence.jetbrains.com/display/TCD8/TeamCity+Documentation – DavidPostill

ответ

-1

Ошибка была в скрипте build.xml.
я работал с генерируемым build.xml, что Eclipse, обеспечивает:

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<!-- WARNING: Eclipse auto-generated file. 
       Any modifications will be overwritten. 
       To include a user specific buildfile here, simply create one in the same 
       directory with the processing instruction <?eclipse.ant.import?> 
       as the first entry and export the buildfile again. --><project basedir="." default="build" name="ci-research-teamcity-test-project"> 
    <property environment="env"/> 
    <property name="ECLIPSE_HOME" value="../../../../eclipse/"/> 
    <property name="debuglevel" value="source,lines,vars"/> 
    <property name="target" value="1.8"/> 
    <property name="source" value="1.8"/> 
    <path id="ci-research-teamcity-test-project.classpath"> 
     <pathelement location="bin"/> 
    </path> 
    <target name="init"> 
     <mkdir dir="bin"/> 
     <copy includeemptydirs="false" todir="bin"> 
      <fileset dir="src"> 
       <exclude name="**/*.java"/> 
      </fileset> 
     </copy> 
    </target> 
    <target name="clean"> 
     <delete dir="bin"/> 
    </target> 
    <target depends="clean" name="cleanall"/> 
    <target depends="build-subprojects,build-project" name="build"/> 
    <target name="build-subprojects"/> 
    <target depends="init" name="build-project"> 
     <echo message="${ant.project.name}: ${ant.file}"/> 
     <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}"> 
      <src path="src"/> 
      <classpath refid="ci-research-teamcity-test-project.classpath"/> 
     </javac> 
    </target> 
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/> 
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler"> 
     <copy todir="${ant.library.dir}"> 
      <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> 
     </copy> 
     <unzip dest="${ant.library.dir}"> 
      <patternset includes="jdtCompilerAdapter.jar"/> 
      <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> 
     </unzip> 
    </target> 
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler"> 
     <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> 
     <antcall target="build"/> 
    </target> 
    <target name="Demo01"> 
     <java classname="pack1.Demo01" failonerror="true" fork="yes"> 
      <classpath refid="ci-research-teamcity-test-project.classpath"/> 
     </java> 
    </target> 
    <target name="Demo02"> 
     <java classname="pack1.Demo02" failonerror="true" fork="yes"> 
      <classpath refid="ci-research-teamcity-test-project.classpath"/> 
     </java> 
    </target> 
</project> 

Вот мой build_custom.xml, что работает, это урезано и упрощено:
(обратите внимание на компилятор = «современный» атрибут в JAVAC задача, это фиксируется другой ошибка я получил, а именно ошибку компиляции: JAVAC - класс не найдено: javac1.8)

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    <!-- Author:   Petrus K. 
      Description: A custom ant build script based on an auto-generated script by Eclipse 4.4.0 
      More info:  http://ant.apache.org/manual/using.html 
    --> 

    <!-- project attributes --> 
    <project basedir="." default="build" name="ci-research-teamcity-test-project"> 
     <description> 
      simple ant build script for demonstrational purposes 
     </description> 

    <!-- properties --> 
    <property name="src" location="src"/> 
    <property name="bin" location="bin"/> 

    <!-- paths --> 
    <path id="classpath"> 
     <pathelement location="bin"/> 
    </path> 

    <!-- targets --> 
    <!-- TARGET init: initializes file and folder structures before compilation --> 
    <target name="init" description="initializes file and folder structures before compilation"> 
     <mkdir dir="bin"/> 
      <copy includeemptydirs="false" todir="bin"> 
       <fileset dir="src"> 
        <exclude name="**/*.java"/> 
       </fileset> 
      </copy> 
     <echo message="init completed"></echo> 
    </target> 

    <!-- TARGET build: compiles the source --> 
    <target name="build" depends="init" description="compiles the source"> 
     <javac srcdir="${src}" destdir="${bin}" includeantruntime="false" compiler="modern"/> 
     <echo message="build completed"></echo> 
    </target> 

    <!-- TARGET clean: cleans the compiled files --> 
    <target name="clean" description="cleans the compiled files"> 
     <delete dir="bin"/> 
     <echo message="clean completed"></echo> 
    </target> 

    <!-- TARGET run: runs the demo project --> 
    <target name="run" depends="build" description="runs the demo project"> 
     <java classname="pack1.Demo01" failonerror="true" fork="yes"> 
      <classpath refid="classpath"/> 
     </java> 
     <echo message="run completed"></echo> 
    </target> 

    </project> 
+0

Это не ответ. Это комментарий или (лучше) редактирование исходного вопроса. –

 Смежные вопросы

  • Нет связанных вопросов^_^