Summary: | javah module no longer works with Java 1.4.2 | ||
---|---|---|---|
Product: | Ant | Reporter: | Calvin Austin <calvin.austin> |
Component: | Optional Tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apache, apache, chuck.fowler, holtje, jallers, jdy, miguel.mulero, Pierre.Nugues, stakken, yair |
Priority: | P1 | ||
Version: | 1.5.3 | ||
Target Milestone: | 1.5.4 | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: | Patch to Javah task to support 1.4.2 changes |
Description
Calvin Austin
2003-04-03 20:25:11 UTC
I have a similar problem using Ant 1.5.1 on Linux with Java 1.4.2 beta. java.lang.NoSuchMethodError: com.sun.tools.javah.Main.<init>([Ljava/lang/String; )V at org.apache.tools.ant.taskdefs.optional.Javah.doClassicCompile(Javah. java:348) at org.apache.tools.ant.taskdefs.optional.Javah.execute(Javah.java:318) at org.apache.tools.ant.Task.perform(Task.java:319) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.Project.executeTargets(Project.java:1250) at org.apache.tools.ant.Main.runBuild(Main.java:610) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) This bug is posted on java.sun.com as bug 4824827 http://developer.java.sun.com/developer/bugParade/bugs/4824827.html The workaround they suggest is <exec/> The sun bug is a bit self centred "Ant will have to check what version JDK it is running on and use a method present on that JDK.", but of course there are no stable public methods; this is the whole problem. We are going to have to fix this as we'll see the bugreps, but I am miffed at their attitude. 'yup, we changed stuff without telling you, you will just have to do a workaround'. Maybe the workaround will have to print out a snide comment in return about Sun's developer team in response, something like "using nonstandard entrypoint on java1.4.2 because whoever maintains javah doesnt like Ant". btw I emailed Richard Beton back in February asking if he was still the javah maintainer because there was an up and coming change to javah. I never received a reply We can get a patch together if someone can tell us what the new main() class is, whether any params or exit values have changed. We like an entry point that does not call System.exit(), incidentally. It looks like javah is now implemented as a doclet. I don't think any of the arguments hava changed. com.sun.tools.javah.Main no longer is constructed with the arguments to run against. The new implementation has a no arg constructor. The new main method verifies the arguments, appends to more arguments for javadoc("-private" and "-Xclasses", and invokes javadoc with the following command, com.sun.tools.javadoc.Main.execute( "javadoc", "com.sun.tools.javah.MainDoclet", args1); "com.sun.tools.javah.MainDoclet" does not appear to invoke System.exit, and I think the execute method of com.sun.tools.javadoc.Main will not call System.exit. I think invoking javadoc with the javah doclet it the way to go for 1.4.2. The 'old' interface is still available as com.sun.tools.javah.oldjavah.Main.main(args) which should see ant through until (java) 1.5. This is what the javah binary currently uses out of curiosity, why was the old entry point moved? Just to see what broke? This was supposed to be some pre work for the up and coming language changes. The javah, javap and related tools use a different compiler 'engine' code than the javac tool. Only one compiler engine would then need to be changed. The person who did the change is no longer here. Created attachment 5684 [details]
Patch to Javah task to support 1.4.2 changes
Thanks james, patch will be in nightly build 2003-04-10. *** Bug 20425 has been marked as a duplicate of this bug. *** *** Bug 20700 has been marked as a duplicate of this bug. *** *** Bug 20896 has been marked as a duplicate of this bug. *** *** Bug 21236 has been marked as a duplicate of this bug. *** *** Bug 21270 has been marked as a duplicate of this bug. *** *** Bug 21375 has been marked as a duplicate of this bug. *** *** Bug 21410 has been marked as a duplicate of this bug. *** *** Bug 21827 has been marked as a duplicate of this bug. *** *** Bug 21942 has been marked as a duplicate of this bug. *** |