[root@V-4836 Source]# java -Xmx800m -cp bin;deps/poi.jar;deps/mysql.jar;deps/mina.jar;deps/slf4j.jar;deps/slf4j-nop.jar;deps/jython.jar;log4j-1.2.15.jar; server.Server
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://java.sun.com/javase/reference for more details.
invalid file (bad magic number): Exec format error
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
invalid file (bad magic number): Exec format error
invalid file (bad magic number): Exec format error
invalid file (bad magic number): Exec format error
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
-bash: log4j-1.2.15.jar: command not found
-bash: server.Server: command not found
Could anyone please reply with a working run code?
Has the Server class been compiled?
Showing usage generally indicates that its incorrect usage and not a failed run. On linux, these classpaths are separated by a colon not a semi-colon.
Has the Server class been compiled?
Showing usage generally indicates that its incorrect usage and not a failed run. On linux, these classpaths are separated by a colon not a semi-colon.
Everything has been compiled, can you please fix the code for me?
Has the Server class been compiled?
Showing usage generally indicates that its incorrect usage and not a failed run. On linux, these classpaths are separated by a colon not a semi-colon.
[root@V-4836 Source]# java -Xmx800m -cp bin:deps/poi.jar:deps/mysql.jar:deps/mina.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server
Exception in thread "main" java.lang.UnsupportedClassVersionError: server/Server : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: server.Server. Program will exit.
The directory you are in, does it have a subdirectory of /server/Server.class from it?
CLI java is such a pain.
Edit:
Wait. This error is an incompatible Java version. Your class was compiled with a greater version of JDK than your JRE.
Update your JRE to at least Java 5.
The directory you are in, does it have a subdirectory of /server/Server.class from it?
CLI java is such a pain.
Edit:
Wait. This error is an incompatible Java version. Your class was compiled with a greater version of JDK than your JRE.
Update your JRE to at least Java 5.
my jre is 6 & my jdk is 14, i'm updating my jre to 7 then will it work?
Last edited by TestingPHP; 06-13-2012 at 06:33 PM..