New to Ant, ClassNotFoundException with JUnit

后端 未结 1 2014
误落风尘
误落风尘 2021-01-12 09:06

I\'ve been scratching my head over this for a while now (Googled a bunch, looked through other related SO posts to no avail). I have a Java program comprised of two files, <

相关标签:
1条回答
  • 2021-01-12 09:39

    You will need to add the directory with the Tests.class to the classpath.tests classpath (which is ${basedir} in your setup)

    Try:

    <path id="classpath.test"> 
      <pathelement location="${basedir}/mysql-connector-java-5.1.18-bin.jar" /> 
      <pathelement location="${basedir}/junit-4.10.jar"/> 
      <pathelement location="${basedir}" /> 
      <path refid="classpath.base" /> 
    </path>
    
    0 讨论(0)
提交回复
热议问题