This question already has an answer here:
I am new to lubuntu. I have installed java8 in my laptop. i need to set up environment variable (sudo nano /etc/environmet) i have entered the JAVA_HOME =" path" but i dont know how to properly save and exit the window. Can you please help me with this ?