Here is a link to the project I am working on: http://www.tutorialspoint.com/viewproject.php?URL=compile_java8_online.php&PID=0Bw_CjBb95KQMRnVYcWhvTHVzUzg It works fine when I run it in Netbeans on my desktop(java 8) but gives me this error when I run it at the link above. It looks like the error might be due to the online compiler not being compatible with the JFrame graphics in some way.
1 Answer
It's because your code is running in a headless environment (no GUI) yet you are creating and using a GUI.
It works fine on your computer because you have a GUI and everything required to display those graphical components.
You can fix/prevent this by creating a program that runs in the terminal and only accepts text input, or installing some sort of virtual gui on the machine that runs it.