Consult the specifications for your compiler. For sun's javac, the search order is described in its manual.
Depending on a few things the manual details, class files in the paths set in the CLASSPATH
environment variable, class files in the paths set the -classpath
command line option, source files in the paths from the '-sourcepathoption, source files in user classpath (if
-sourcepathisn't given), and either the JVM's default boot and extension paths or the paths given by the
-bootclasspathand
-extdirs` options.
As javax.media is a JVM extension, javac would look either in the JVM's extensions directory, or that provided by -extdirs, then in user class folders, then in user source folders.