jar - I can't figure out how to call Java oscar3 class method stringToString from the command line -
i'm trying call java class method command line life of me can't figure out syntax. method stringtostring found in class http://apidoc.ch.cam.ac.uk/oscar3/apidocs/uk/ac/cam/ch/wwmm/oscar3/oscar3.html
what have tried:
java -xmx512m -classpath .:oscar3-a5:lib/oscar3-a5.jar uk.ac.cam.ch.wwmm.oscar3.oscar3 stringtostring "test" java -xmx512m -classpath .:oscar3-a5:lib/oscar3-a5.jar uk.ac.cam.ch.wwmm.oscar3 oscar3(stringtostring "test) java -classpath .:oscar3-a5.jar:lib/uk.ac.cam.ch.wwmm.oscar3.oscar3 stringtostring "test"
it complains this:
exception in thread "main" java.lang.noclassdeffounderror: uk/ac/cam/ch/wwmm/oscar3/oscar3 caused by: java.lang.classnotfoundexception: uk.ac.cam.ch.wwmm.oscar3.oscar3 @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:306) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) @ java.lang.classloader.loadclass(classloader.java:247)
i have looked @ (java: how import jar file command line) solution i'm retarded see obvious. if knows correct syntax great.
you close! think want following:
java -xmx512m -cp oscar3-a5/oscar3-a5.jar uk.ac.cam.ch.wwmm.oscar3.oscar3 stringtostring test
alternatively if current working directory (pwd
) same directory oscar3-a5.jar
resides in, then:
java -xmx512m -cp ./oscar3-a5.jar uk.ac.cam.ch.wwmm.oscar3.oscar3 stringtostring test
(i've assumed you're running on *nix - if you're running on windows replace /
\
)
Comments
Post a Comment