Not able to configure path to run java class in ANT build file

By | July 12, 2018

I have a directory

tools > util > src > utilities > legacy > and

build.xml on same level as tool.

I am trying to run this inside ANT file

  <property name="sql.dir" value="${basedir}/tools/util/src/utilities/legacy" />
 <java  failonerror="false" fork="true" classname="" classpath="${sql.dir}">
  <arg value="sourcefiles"/>
  <arg value="${gen.dir}"/>

The exception I get while trying to run is

[java] Exception in thread "main" java.lang.NoClassDefFoundError: SqlGenerator            
[java] Caused by: java.lang.ClassNotFoundException: SqlGenerator        
[java]  at$      
[java]  at Method)  
[java]  at  
[java]  at java.lang.ClassLoader.loadClass(     
[java]  at sun.misc.Launcher$AppClassLoader.loadClass(    
[java]  at java.lang.ClassLoader.loadClass(      
[java] Could not find the main class: SqlGenerator.  Program will exit.  
[java] Java Result: 1

Leave a Reply

Your email address will not be published. Required fields are marked *