Jae Carr
Jae Carr

Reputation: 1225

Import com.sun.javadoc, using with Eclipse and Ant

I have an open source project I'm working with called RapidMiner where I need to be able to use com.sun.javadoc so that I can compile a plug-in using an Ant build file. I found a thread that explained that I needed to include the .jar from the JDK and gave some simple instructions on how to do this (See here).

It seems to have worked on a basic level. I now can use com.sun.javadoc and have it work with content assist. So I'm under the impression that Eclipse, at very least, can see it.

The problem is that Ant refuses to see it. I've made sure that when I run build.xml it uses the proper JRE (called jre7JDK in my particular case). But evertime I run the build I get this error (the second error is the important one):

build.common:
 [echo] RapidMiner: Compile with Java from dir: C:\Program Files\Java\jre7
 [echo] RapidMiner: using Java version: 1.7.0_17
[javac] Compiling 12 source files to C:\Users\jcarr14\Eclipse\Workspace\RapidMiner_Unuk\build
[javac] C:\Users\jcarr14\Eclipse\Workspace\RapidMiner_Unuk\src\com\rapidminer\doc\AbstractOperatorDocGenerator.java:40: warning: [deprecation] com.rapidminer.operator.condition.InnerOperatorCondition in com.rapidminer.operator.condition has been deprecated
[javac] import com.rapidminer.operator.condition.InnerOperatorCondition;
[javac]                                         ^
[javac] C:\Users\jcarr14\Eclipse\Workspace\RapidMiner_Unuk\src\com\rapidminer\doc\AbstractOperatorDocGenerator.java:49: package com.sun.javadoc does not exist
[javac] import com.sun.javadoc.ClassDoc;

There are a few thousand more errors listed as well, but they all boil down to the same thing, Ant is not compiling in a way that see's the JDK's .jars, which I need to include. How do I make Ant see those .jars?

Upvotes: 1

Views: 1841

Answers (1)

Jae Carr
Jae Carr

Reputation: 1225

The answer actually turned out to be pretty straight forward. All I did was point the Ant build in Eclipse at the actual JDK itself (which was alluded to in another thread that I cannot seem to find...). I did this by creating a new Environment wide JRE that was pointed at the JDK's root folder instead. Then when I would go to use build.xml, I would use "Run As..." then Ant Build, then I would go to the JRE tab and select the JDK backed JRE. It's worked fine ever since.

I'm still not quite sure why including the JDK jars inside of my custom JRE didn't work, but there you go.

Update: Found the post it was "alluded to" in. Though when I read it now, it seems pretty straight forward (as it often does after you get it working): Right here.

Upvotes: 1

Related Questions