Packages that are not included in the JDK (for example
After compilation, when the .class files are obtained, is it possible to transfer these files to a computer that does not have the
javax.websocketpackage, and have the JVM on that computer run them, or is it necessary to have the package on both computers?
It is necessary to have the package on both computers. Bytecode assumes that the relevant classes would be made available to JVM at runtime.
Moreover, this is true even for compiling and running on the same computer: the locations from which Java compiler pulls its packages for compilation could be different from the location from which JVM pulls packages when running your code.