Java compiler in Ubuntu for Windows
I want to know if there is a way to add the compiler that I downloaded from apt-get to the Windows path
There isn't. If your windows based editing environment requires you to have a java compiler installed then you need to install a compiler on windows. It's one of the major annoyances of wsl programming.
That said, I probably wouldn't use wsl at all for java programming. It's one of the few languages that doesn't feel annoying to program on windows at all. It has great windows tooling and build scripts.
More on reddit.comCan someone please guide me through the installation of JDK on Linux?
If it's based on Ubuntu you'll be able to install it via the package manager.
Go to your shell and type
sudo apt-get install openjdk-8-jdk
This will install OpenJDK, not Oracle JDK. For the Oracle JDK you need to add a PPA first:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer