JDK means Java Development Kit. You need it to compile java codes. You can use a text editor to write code and execute it using terminal if you have installed JDK.
An IDE is used for ease of coding. IDEs support code completion,syntax highlighting etc. You need JDK installed for using IDE.
solved What is the difference between the IDE and JDK and when do you use each one? [closed]