This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes build issue while using ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "build issue while using ant" Watch "build issue while using ant" New topic

build issue while using ant

Ponnusamy Gov

Joined: Feb 01, 2011
Posts: 18
I am using ant build version 1.9.3 and compiling the java files. One of my java file is having import statement sun.reflect.misc.MethodUtil. During build I am getting exception "package sun.reflect.misc does not exist", but I am having rt.jar in the JDK lib where JAVA_HOME is referred. Please help to resolve this. Thanks is advance

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
That file is not normally included in the compile classpath. Note its name "rt = runtime". You need to include it especially.

Even better would be not to rely on it at all, of course - the usual warnings about code in proprietary JVM packages apply.
Ponnusamy Gov

Joined: Feb 01, 2011
Posts: 18
I have solved this issue by adding attribute bootclasspathref in javac by giving the path of rt.jar. But I am not sure whether this is permanent solution or temperary. Anyway thanks!!!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: build issue while using ant
It's not a secret anymore!