У меня небольшие проблемы с моей первой сборкой муравьев в eclipse, вот мой файл build.xml build.xml.Java - Ant build (Eclipse) - Не удалось найти основной класс: nat.rutherford.DesktopStarter
<project name="Rutherford" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="libs" value="libs"/>
<path id="classpath">
<fileset dir="${libs}" includes="**/*.jar"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" classpathref="classpath">
<compilerarg line="-encoding utf-8"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/MyProject-${DSTAMP}.jar" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="nat.rutherford.DesktopStarter"/>
</manifest>
</jar>
</target>
<target name="run">
<java jar="${dist}/MyProject-${DSTAMP}.jar" fork="true"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
Он компилирует нормально без каких-либо предупреждений или ошибок, но когда я пытаюсь запустить .jar он говорит, «Не удалось найти основной класс: nat.rutherford.DesktopStarter. Программа теперь выход = (
Я прочитал тонну страниц по этому вопросу, но до сих пор ничего убедительного
я смог скомпилировать его с помощью Eclipse, -.> Файл -> Экспорт -> Java -> Runnable Jar File. Но я использую некоторые файлы с кодировкой UTF-8 .txt, которые, похоже, не могут справиться с этим, и я нуждаюсь в них, т.е. у меня есть греческие символы, которые должны читать ... dσ/dΩ ... но в настоящее время читается ... dÃ/d © ... который не собирается работать ^^
Так что в основном мне нужно сделать работу над Ant, не забывая, что она должна иметь возможность обрабатывать мои UTF- 8 также закодированных файлов .txt.
Этот класс существует? –