我有这个Java类:
public class SortAlgorithms {
public static void main(String... args) {
String out = "";
int vec1[] = readFile(args[0]);
out = out + write(vec1);
out = out + "=== INSERTION SORT ===\n";
insertionSort(vec1, vec1.length);
out = out + write(vec1) + "\n";
...
}
...
}
我将它部署在我的 Boinc 平台上的其他机器上。有一个 bash 脚本来运行这个类:
#!/bin/sh
export JAVA_HOME="/usr/java/jdk1.6.0_34/"
export PATH=${JAVA_HOME}/bin:${PATH}
java SortAlgorithms 10 "output.txt" > saida.txt
我收到这个错误:
<stderr_txt>
Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 1014198118 in class file SortAlgorithms
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: SortAlgorithms. Program will exit.
</stderr_txt>
有谁知道发生了什么?提前谢谢。费利佩