View Full Version : microsoft virtual machine?????
_underdog
05-16-2003, 02:37 PM
I am writing a small application for one of our clients at work. The virtual machine they have installed on their system is the microsoft vm. I was looking into how I could use that to run the application but I am haveing trouble just getting a simple helloworld program to run. If my test program is called HelloWorld.class I type:
jview HelloWorld
at the command prompt and all I get is:
ERROR: java.lang.NoClassDefFoundError
Any one know what I am doing wrong... It works correctly if I execute it from the command prompt using suns virtual machine with the command:
java HelloWorld
gufmn
05-16-2003, 02:48 PM
I'm assuming you compiled first.
Sounds to me like an environment variable issue.
Try just typing "java" and "javac" from the command prompt. It should spit back a bunch of options. If it does, then I would wager your classpath is not set to the dir where you saved the files.
_underdog
05-16-2003, 03:09 PM
Yes I compiled it. I used javac to compile it and java to run it and everything works fine. Now when I type jview to run it that is when I get an error. I can't get jview to execute anything. I get the same error no matter what. I am in the directory where the class file is located when I try and execute it. I even tried to set the class path. for jview the usage is:
Usage: JView [options] <classname> [arguments]
Options:
/? displays usage text
/cp <classpath> set class path
/cp:p <path> prepend path to class path
/cp:a <path> append path to class path
/n <namespace> namespace in which to run
/p pauses before terminating if an error occurs
/v verify all classes
/d:<name>=<value> define system property
/a execute AppletViewer
/vst print verbose stack traces (requires debug classes)
/prof[:options] enable profiling (/prof:? for help)
Classname:
.CLASS file to be executed.
Arguments:
command-line arguments to be passed on to the class file
I use java every day... I never have a problem. It must be something simple, but I just can't see it.
_underdog
05-16-2003, 03:33 PM
Well I got it to work. When I compiled I compiled it for java 1.1 and it worked:
javac -target 1.1 HelloWorld.java
I guess if it was compiled for java 1.4 it just would not run with jview.
gufmn
05-16-2003, 05:52 PM
Kewl. Glad you got it working :)
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.