Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32887 - [jdk7-openjdk] Please include Java API documentation package

Attached to Project: Arch Linux
Opened by Peter Wu (Lekensteyn) - Tuesday, 27 November 2012, 23:02 GMT
Last edited by Guillaume ALAUX (galaux) - Tuesday, 11 December 2012, 20:54 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Guillaume ALAUX (galaux)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As the comments on java7-openjdk says:

# ToDo -demo -doc packages, see Debian file lists http://packages.debian.org/source/wheezy/openjdk-7

From its rules file:

770 p_jre = $(basename)-jre
...
779 p_doc = $(basename)-doc
...
792 d_doc = debian/$(p_doc)
...
1839 ifeq ($(with_docs),yes)
1840 dh_installchangelogs -p$(p_doc)
1841 dh_installdocs -p$(p_doc)
1842 mkdir -p $(d_doc)/usr/share/doc/$(p_jrehl)
1843 for i in build/openjdk.build/docs/*; do \
1844 [ -e $$i ] || continue; \
1845 b=$$(basename $$i); \
1846 cp -a $$i $(d_doc)/usr/share/doc/$(p_jrehl)/; \
1847 ln -sf ../$(p_jrehl)/$$b $(d_doc)/usr/share/doc/$(p_doc)/$$b; \
1848 done
1849 endif
...

So basically it is:
1. copying files/dirs from ${srcdir}/icedtea-${_icedtea_ver}/openjdk.build/docs/ that exist (ignore symlinks?) to /usr/share/doc/$basename-jre/
2. creating symlinks /usr/share/doc/$basename-doc/$foo /usr/share/doc/$basename-jre/$foo

Looking at the package list of the Ubuntu openjdk-7-doc package, I see:
1 openjdk-7-doc: /usr/share/doc-base/openjdk-7-jdk-doc
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/api
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/changelog.Debian.gz
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/copyright
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/jdk
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/jre
1 openjdk-7-doc: /usr/share/doc/openjdk-7-doc/platform
9568 openjdk-7-doc: /usr/share/doc/openjdk-7-jre-headless/api/
733 openjdk-7-doc: /usr/share/doc/openjdk-7-jre-headless/jdk/
702 openjdk-7-doc: /usr/share/doc/openjdk-7-jre-headless/jre/
2 openjdk-7-doc: /usr/share/doc/openjdk-7-jre-headless/platform/
(the number indicates the number of files/directories that have the same prefix)

When I built the OpenJDK package, I can indeed observe that the openjdk.build/docs directory have four subdirectore, api, jdk, jre and platform. I have attached a patch to java7-openjdk PKGBUILD that creates a -doc package. I found /usr/share/doc/openjdk7-doc the most suitable location for this.
This task depends upon

Closed by  Guillaume ALAUX (galaux)
Tuesday, 11 December 2012, 20:54 GMT
Reason for closing:  Implemented
Additional comments about closing:  Will be shipped with next release
Comment by Guillaume ALAUX (galaux) - Wednesday, 28 November 2012, 15:16 GMT
Hello.

Is there any good reason to create "doc" and "demo" packages? The fact that these files are present on the binary tarball and on the Debian package does not mean we *should* ship them.

Debian package "-doc" is a 21M [0] bunch of tar'ed HTML (240M untar'ed) that is seldom used by Java developpers (to whom I belong) as you can get it online [1].
Debian package "-demo" [2] holds several examples that should be removed for a "production" environment to prevent possible security breaches.

Do get me wrong: I'm just curious to know if you have good reasons for.

[0] http://packages.debian.org/sid/openjdk-7-doc
[1] http://docs.oracle.com/javase/7/docs/api/
[2] http://packages.debian.org/sid/amd64/openjdk-7-demo/filelist
Comment by Peter Wu (Lekensteyn) - Wednesday, 28 November 2012, 17:40 GMT
Some demo files are already included (not sure why, imo they are not really useful).

About the documentation (which is why I opened this bug), I'd like to have some up-to-date documentation available offline. That brings me the following advantages:
1. I can grep for a keyword on the local filesystem. Given that I have a SSD, search time is minimal.
2. I lately have wireless issues, so even if Google/docs.oracle.com is not available, I'd like to have some documentation.
3. In netbeans, if I press Alt + F1 (iirc), I would get a nice tooltip with API docs on Ubuntu. On Arch, it just opens the webbrowser (presumably because local API documentation is missing).
Comment by Guillaume ALAUX (galaux) - Thursday, 06 December 2012, 10:09 GMT
OK this was implemented in the following commit
https://projects.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/java7-openjdk&id=20fd0fa935a90e139483c840ac05fdd34d213fd5

I've created the sub-package 'openjdk7-doc' and removed subfolders 'demo' and 'sample' from jdk7-openjdk. These changes will come with the next official OpenJDK 7 release.

But in the meantime you will find a '-2' package here that ships these changes.
https://dev.archlinux.org/~guillaume/openjdk7/

Could you please install and provide feedback here? To use the javadoc I had to manually add a javadoc location in Netbeans.

Thanks
Comment by Peter Wu (Lekensteyn) - Thursday, 06 December 2012, 17:32 GMT
After installing openjdk7-doc, I went to Tools > Java Platforms. Under Platforms, JDK 1.7 was selected.
The next step is opening the Javadoc tab, press the Add ZIP/Folder button and insert:

/usr/share/doc/openjdk7-doc/api
After confirming the location with the "Add ZIP/Folder" button in the file picker, I pressed "Move Up" to increase priority.

So, I now have the documentation available locally, yay. Do you know the keyboard shortcut to show Javadoc in a tooltip? Ctrl + Space sometimes helps, but that is an auto-complete function.

This bug can be marked as implemented if you'd like to.
Comment by Guillaume ALAUX (galaux) - Tuesday, 11 December 2012, 20:53 GMT
No clue about the shortcut.

Thanks for the feedback.

Loading...