If you don't understand any of these steps, or can't get them to work, just skip over them and continue; we'll see if there's a sensible error message at where you get to.
- Ensure you have a working Java 8 (or Java 9?) JDK installed. Oracle have official builds.
- Check out the sources (jdk8_tl or jdk9_dev).src[share]:java.util..*
- Download the latest version of Intellij IDEA you can get your hands on, and unpack it.
- Get IDEA some memory. Edit idea64.vmoptions. Xmx: ~at least 3g. MaxPermSize is less relevant, as we're not running all that much code. If you have less memory available, you really don't want to go into swap.
faux@astoria:~% cat idea-IC-133.696/bin/idea64.vmoptions
- Create a new project
- location: e.g. /home/faux/code/jdk8_tl/jdk/src/share
- jdk: new jdk: (for a build) e.g. /home/faux/code/jdk8_tl/build/linux-x86_64-normal-server-release/images/j2sdk-image/
- Ok! This should open up the sources, but not have identified any of it as source.
- IDEA settings (not project structure):
- search for “build process heap”
- Build process heap size (Mbytes): 3000 (not sure what the lowest possible value for this is, pretty sure it's over 2g. Obviously you don't want to be in swap if you can avoid it.)
- Project structure (the other IDEA settings dialog): language level: 8.0.
- Edit the JDK (project structure)'s classpath to "add" "..../images/j2sdk-image/lib/*.jar", e.g. including "tools.jar", "dt.jar", ...
- Right-click the "classes" as a source folder, "build-path", "use as source folder".
- The SNMP stuff seems not to build with this method, this is still unknown. You can exclude it from the project; right-click on an offender and "build path" -> "exclude".
- Everything else seems to build.
You can now run analysis on specific interesting packages. For example, let's say we want to inspect "java.util" for the default warning set:
- Analyse -> Inspect code...
- Custom scope
- name is irrelevant
- Expand "production classes" -> "share" -> "java" -> "util".
- Include recursively (this generates a pattern of "src[share]:java.util..*")
- Inspection profile is fun to play with. Defaults are fine, ish.