<p>Right now my ant task looks like.</p>

<pre><code>&lt;javadoc sourcepath="${source}" destdir="${doc}"&gt;
    &lt;link href="http://java.sun.com/j2se/1.5.0/docs/api/" /&gt;
&lt;/javadoc&gt;
</code></pre>

<p>And I'm getting this warning:</p>

<pre><code>javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list
</code></pre>

<p>How do I get the javadoc to properly link to the API?  I am behind a proxy.</p>

[{'answer_id': 52973, 'author': 'erickson', 'author_id': 3474, 'author_profile': 'https://Stackoverflow.com/users/3474', 'pm_score': 4, 'selected': True, 'text': '<p>You probably need the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html" rel="noreferrer">http.proxyHost and http.proxyPort system properties</a> set. For example, <code>ANT_OPTS="-Dhttp.proxyHost=proxy.y.com" ant doc</code></p>\n\n<p>Alternatively, you could set the "offline" flag and provide a package list, but that could be a pain for the Java core.</p>\n'}, {'answer_id': 54281, 'author': 'Rob Spieldenner', 'author_id': 5118, 'author_profile': 'https://Stackoverflow.com/users/5118', 'pm_score': 4, 'selected': False, 'text': '<p>You can also pass the arguments inside the ant task</p>\n\n<pre><code>&lt;arg value="-J-Dhttp.proxyHost=your.proxy.here"/&gt;\n&lt;arg value="-J-Dhttp.proxyPort=##"/&gt;\n</code></pre>\n\n<p>If going the offline link route.  Download the package list by going to the URL of the Java API (<a href="http://java.sun.com/j2se/1.5.0/docs/api/package-list" rel="noreferrer">http://java.sun.com/j2se/1.5.0/docs/api/package-list</a>) and saving it as a text file and then using this Ant task.</p>\n\n<pre><code>&lt;javadoc sourcepath="${source}" destdir="${doc}"&gt;\n    &lt;link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistloc="path-containing-package-list"/&gt;\n&lt;/javadoc&gt;\n</code></pre>\n'}, {'answer_id': 27277943, 'author': 'Patrice M.', 'author_id': 366749, 'author_profile': 'https://Stackoverflow.com/users/366749', 'pm_score': 0, 'selected': False, 'text': '<p>You can also use the "offline" mode that allows you to build (faster!) without accessing the internet. Please see this answer: <a href="https://stackoverflow.com/a/24089805/366749">https://stackoverflow.com/a/24089805/366749</a></p>\n'}]
['https://Stackoverflow.com/questions/52954', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5118/']