title: Using javah maven-antrun-plugin with jdk 1.7, classes.jar became tools.jar
body: <p>In jdk 1.7 for the Mac, the location of com.sun.tools.javah.Main moved from classes.jar to tools.jar. Consequently, Maven's maven-antrun-plugin cannot find the run the javah task and  a ClassNotFound exception is thrown:</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: com.sun.tools.javah.Main
  at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java :50)
  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
  at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:186)
  at org.apache.tools.ant.taskdefs.optional.javah.SunJavah.compile(SunJavah.java:57)
  ... 47 more
  </code></pre>
  
  <p>1.7 Location:  /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/lib/tools.jar</p>
  
  <p>1.6 Location: /Library/Java/JavaVirtualMachines/1.6.0_32-b05-420.jdk/Contents/Classes/classes.jar</p>
  
  <p>This seems like a bug or failure of maven version 3.0.4. I considered making tools.jar a plugin dependency, but that just doesn't seem right. I tried these solutions, but I couldn't get them to work:</p>
  
  <p><a href="https://stackoverflow.com/questions/3080437/jdk-tools-jar-as-maven-dependency">JDK tools.jar as maven dependency</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6219533/maven-how-to-load-tools-jar-classes-jar-in-an-os-independent-way">maven: How to load tools.jar/classes.jar in an OS independent way?</a></p>
  
  <p>Any work around until the maven folks address the maven-antrun-plugin with jdk-1.7 on mac?</p>