The nanoTime() method is new in Java 5 (also called JDK 1.5). Anything older won't recognize it, including JDK 1.4.
It's OK to have multiple versions of Java on one machine, but you do need to keep them straight, and make sure you know that the API you're using corresponds to the Java version of both the compiler and the runtime you're using. Finally, note that if you use this API (and even if you don't, but you compile with a JDK 1.5 compiler), your class files won't run on a JDK 1.4 runtime.
You need to find the JDK 1.5 installation directory, and use the javac.exe from there.