Hello everyone.
I'm having a problem with IntellJ.
I've tried to run idea.sh but I'm getting this output:

lucassith@linux-fgb5:~/bin> sudo ./idea.sh
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Exception in thread "main" java.awt.HeadlessException: Unable to detect graphics environment
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at com.intellij.idea.Main.main(Main.java:63)
Java --version outputs

lucassith@linux-fgb5:~> java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
I have KDE Desktop + Nvidia Optimus. Do you know what may cause this error? I have to add that I've installed JDK for NetBeans, and it works properly.