This is a $PATH issue. $PATH is an environment variable that contains a list of directories to search when looking for an executable. You can see your current $PATH via
javac: command not found indicates javac is not in any of the directories in your $PATH. You need to add the directory with javac in it into your $PATH, or add javac to one of the directories in your $PATH -- but the former is much preferable.
To temporarily add a directory for your current shell:
If you want to use that permanently, add the same line to
~/.bashrc. For example, I use JDK 8 on the pi that I have installed to /usr/local, so I have a line:
That directory contains java, javac, jar, etc.
You mentioned that java appears in be in your path since "java -version comes up with the java number and package so java is definitely installed" although you do not actually say what that number and package are. I suspect you have multiple versions installed, one of which is just a jre and thus does not include javac.