cannot resolve symbol

Status
Nicht offen für weitere Antworten.
H

hard

Gast
Hallo,

ich bin gerade dabei JUNIT-Tests zu schreiben. Mein JUNIT-TEST läuft durch(grün). Aber wenn ich builden will kommt diese Fehlermeldung:

location: class ...
Test k = new Test(); cannot resolve symbol.

Die Exception(cannot resolve symbol) kommt auch bei import dieser Test klasse z.B:
import ... Test cannot resolve symbol

Was kann der Gründe dafür sein?

Danke
 
H

hard

Gast
ja. Das schon. Ich glaube ich muss noch etwas in ant anpassen oder nicht?


Danke
 

clemson

Bekanntes Mitglied
junit mittel ant task ist etwas tricky... ich habs so gelöst, dass die junit.jar im ant classpath liegt, damit der den <junit> task findet. ist die junit.jar nicht im ant classpath (ANT_HOME/lib) sondern "nur" im task-classpath, dann wird der <junit> task nicht ausgeführt, da die junit.jar und respektive die task-klasse nicht gefunden wird...

aber es gibt noch andere lösungen

[url=http://ant.apache.org/manual/OptionalTasks/junit.html hat gesagt.:
ant.apache.org[/url]]Note: You must have junit.jar and the class files for the <junit> task in the same classpath. You can do one of:

1. Put both junit.jar and the optional tasks jar file in ANT_HOME/lib.
2. Do not put either in ANT_HOME/lib, and instead include their locations in your CLASSPATH environment variable.
3. Do neither of the above, and instead, specify their locations using a <classpath> element in the build file. See the FAQ for details.

edit: beantwortet zwar nicht direkt deine frage, aber vielleicht hilft es doch, dass das Test interface gefunden wird...
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben