I'm using IntelliJ and developing code using Java.
When I use "Go to Declaration" [Ctrl+B] to a Java inbuilt feature (e.g. ArrayList), it takes me to that class (e.g. ArrayList.class) and looks a bit like this:
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package java.util;
public class ArrayList <E> extends java.util.AbstractList<E>
implements java.util.List<E>, java.util.RandomAccess,
java.lang.Cloneable, java.io.Serializable {
private static final long serialVersionUID = 8683452581122892189L;
private static final int DEFAULT_CAPACITY = 10;
private static final java.lang.Object[] EMPTY_ELEMENTDATA;
private transient java.lang.Object[] elementData;
private int size;
private static final int MAX_ARRAY_SIZE = 2147483639;
public ArrayList(int i) { /* compiled code */ }
public ArrayList() { /* compiled code */ }
public ArrayList(java.util.Collection<? extends E> es) { /* compiled code */ }
However I seen it on other computer and it actually shows the Java source, not just a comment saying "compiled code".
How do I get this on my computer. Have I set up Java incorrectly?
You should be able to configure it in your project structure (ctrl + alt + shift + S) settings here:
Is your JDK pointing to an invalid Sourcepath?
I'm on Ubuntu 16.04 and OpenJDK 8. To get the JDK sources I had to separately install an additional package:
sudo apt-get install openjdk-8-source
Thanks to https://askubuntu.com/questions/755853/how-to-install-jdk-sources for the solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With