I'm running into problems trying to use The Grinder. The tutorial on the site tells me to run "StartAgent.bat", which looks like this:
call "C:\Documents and Settings\dkeller\Desktop\Grinder\setGrinderEnv.bat"
java -cp %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES%
When I open the Command Console and try to run it, I get this error:
"C:\Documents and Settings\dkeller\Desktop\Grinder>java -cp "C:\Documents and Settings\dkeller\My Documents\grinder-3.4"\lib\grinder.jar;"C:\Documents and Settings\dkeller\My Documents\grinder-3.4"\lib\grinder.jar;"C:\Documents and Settings\dkeller\My Documents\grinder-3.4"\lib\grinder.jar;"C:\Documents and Settings\dkeller\My Documents\grinder-3.4"\lib\grinder.jar; net.grinder.Grinder "C:\jython2.5.2\grinder.properties"
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/grinder/G
rinder (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)"
Yikes. Not totally sure what the problem is. Thinking it might be an issue with java versions, I made sure to update to the latest, but I'm not sure if it worked correctly. Here are some commands I ran, so you can see what I mean.
"java -version" returns
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
and "javac -version" returns
javac 1.6.0_26
Any help would be muc开发者_如何学JAVAh appreciated, as I'm not sure what to try next.
Looks like your PATH environment variable is the problem. It's probably easiest just to edit that to have your JDK's bin directory in the PATH of the "user" part of the environment variables, so it comes before anything else which might contain java.exe.
Basically when you run java -version
, you want it to show the same version number as javac -version
.
Alternatively, you might consider uninstalling Java 1.4.2 unless you're still using it for something else...
精彩评论