Re: running a compiled program using 'java' command fails, 'sablevm' succeeds

David Bélanger <[email protected]> Wed, 20 Apr 2005 23:45:50 -0400
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
On Tue, Apr 19, 2005 at 07:36:30PM -0400, mel kravitz wrote:
> hi,
> with debian-unstable on an i386, sableVM-1.11.3, jikes compiler,
> java -version
> SableVM version 1.11.3
> - compile date and time: 2005-04-07 23:38:28 UTC
> - gcc version: 3.3.5 (Debian 1:3.3.5-12)
> - 'real life brokenness' features enabled
> - signal based exception detection
> - copying garbage collection
> - bidirectional object layout
> - inline-threaded interpreter
> #javac Program.java , compiles .class fine, but
> # java Program , failes with:
> #java.lang.ClassNotFoundException: Program not found in 
> java.lang.ClassLoader$1{urls=[file:/usr/local/share/sablevm-classpath/libclasspath.jar], 
> parent=null}
>   at java.net.URLClassLoader.findClass (URLClassLoader.java:841)
>   at java.lang.ClassLoader.loadClass (ClassLoader.java:360)
>   at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1285)
>   at java.lang.ClassLoader.loadClass (ClassLoader.java:304)
>   at java.lang.VirtualMachine.main (VirtualMachine.java:99)
> #sablevm Program runs fine?
> .bash_profile:
> PATH=/usr/bin:"${PATH}"
> JAVA_HOME=/usr/local/lib/sablevm
> export JAVA_HOME
> PATH=$PATH:/usr/bin/:/usr/local/lib/sablevm/bin:/usr/local/bin:/usr/local/bin
> CLASSPATH=/usr/local/lib/sablevm/jre/lib
> export CLASSPATH
> -Mel
> 

Hi Mel,

This is because the CLASSPATH variable is defined but does not include
"." (current directory).
Use: CLASSPATH=/usr/local/lib/sablevm/jre/lib:.

The current directory is included by default only if no CLASSPATH is
defined.

David

---

David Bélanger
Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt