java
says it can't find the class file. What might I do to fix it?
The classpath for the JVM may be set; it should be unset (Troubleshooting, page 22 (7th ed.) or 24 (8th ed.)).
It turns out that the JVM does not look in the current directory if an explicit classpath is given, unless the explicit classpath contains an entry for the current directory. Deleting the explicit classpath causes the JVM to revert to its default classpath, which is the current directory.
There are (at least) two ways. The first is to translate C++ into Java byte code; the resulting class files can be treated like any other class files, which includes being downloaded and executed in a browser (subject to the security constraints all class files must follow; Common Misconceptions About Java, page 12 (7th ed.) or 11 (8th ed.)). The second way is to create a separate virtual machine tailored for C++ and use it in a way similar to the JVM (Interpreted, page 5 (7th ed.) or 6 (8th ed.)).
This page last modified on 31 March 2008. |
|