When we use android studio or NetBeans in a parallel system that time we need two JDK or Java version for run application.
For Instance:- Netbeans 7.1.1 need 1.7 JDK and on the flip side android studio needs 1.8 so this article helps you a lot.
I have installed two versions of JDK and I do not know which version is the default.
For check version:-
The best way is to check current version and how to change the priority using the below command.
For Setup or change version:-
update-alternatives --config java
After inserting command in prompt you can see a message like this press enter to keep the current choice: in that space enter valid selection number which you want to make default.