Ant findet JDK-Tools nich

Status
Nicht offen für weitere Antworten.

diggaa1984

Top Contributor
hiho,

ich wollt mich grad mal dran probieren mir n umfangreicheres ant-script für ein projekt zu basteln, sicher kann ich das auch alles mit eclipse irgendwo einstellen, dennoch würde ich gern mal solch ein build-tool nutzen.

allerdings stolper ich schon beim Versuch nur den source mit javac zu compilieren :D

build.xml:
[XML]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="gfeConsole" default="build_project">
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="lib" value="lib"/>
<property name="src" value="src"/>

<target name="build_project" description="compiles source-code">
<echo>"Compiling all sourcefiles within ${src}"</echo>
<mkdir dir="${build}" />
<javac srcdir="${src}" destdir="${build}"/>
</target>
</project>
[/XML]

Ausgabe nach Run:
Code:
[COLOR="Navy"]Buildfile: C:\Eclipse 3.4\Workspace\FormeleditorKonsole\build.xml
build_project:[/COLOR]
     [COLOR="SandyBrown"][[/COLOR][COLOR="Navy"]echo[/COLOR][COLOR="#f4a460"]] [/COLOR][COLOR="SandyBrown"]"Compiling all sourcefiles within src"[/COLOR]
    [[COLOR="#000080"]javac[/COLOR]] [COLOR="RoyalBlue"]Compiling 3 source files to C:\Eclipse 3.4\Workspace\FormeleditorKonsole\build[/COLOR]

[COLOR="Red"]BUILD FAILED[/COLOR]
[COLOR="Navy"]C:\Eclipse 3.4\Workspace\FormeleditorKonsole\build.xml:11: Unable to find a javac compiler;[/COLOR]
[COLOR="Red"]com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "F:\Programme\Java\jre1.6.0_07"[/COLOR]

Total time: 828 milliseconds

so dacht ich mir, gut kiekst mal ant-Manual, da steht:
... Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is installed. ...

... The classpath for Ant must contain ant.jar and any jars/classes needed for your chosen JAXP-compliant XML parser.
When you need JDK functionality (such as for the javac task or the rmic task), then tools.jar must be added ...

gesagt - tun - getan .. immer noch die selbe Fehlermeldung


.. hm nach ewiger urmklickerei hab ich gerade in eclipse auch nen wizward für die run-Configuration des ant-files gefunden .. könnte ich also dort im Classpath zB die tools.jar angeben .. aber ich kann diese Configuration in EclipseJEE 3.4 nicht übernehmen oder dergleichen, wenn ich da auf OK drücke passiert einfach nix, im schlimmsten Fall ist OK oder Apply sogar ausgeblendet o_O .. sieht mir stark nach Programmfehler aus, denn es gibt 0 Fehlermeldungen, und nur weil ich ne jar in Ant-Classpath schleuse kann ich doch nich soviel falsch gemacht haben o_O

EDIT: ja in der Classpath-Umgebungsvariablen steht etwas drin, werd das gleich mal rausnehmen, ABER dennoch muss das über Eclipse ja auch klappen :bahnhof:
 
Zuletzt bearbeitet:
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben