|
I have a simple Java 6 test program, just one class:
import java.nio.charset.*;
public class Test18jn2012 {
public static void main(String[] args) {
String str = "I like Spam.";
byte[] bytes;
bytes = str.getBytes(Charset.defaultCharset());
for (int i=0; i< bytes.length; i++) System.out.print(bytes[i] + "
"); System.out.println();
}
}
It executes just fine in Eclipse. It executes just fine on a WinDoze
command line, even if I move it to a different directory from where I'd
compiled it into.
But when I FTP Test18jn2012.class to the IFS root on our 400, and I try
java Test18jn2012
from either a regular command line or a QShell command line, I get:
Exception in thread "main" java.lang.UnsupportedClassVersionError: (Test18jn2012) bad major version at offset=6and if I try
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:267)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:600)
at java.net.URLClassLoader.access$400(URLClassLoader.java:124)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1055)
at java.security.AccessController.doPrivileged(AccessController.java:274)
at java.net.URLClassLoader.findClass(URLClassLoader.java:492)
at java.lang.ClassLoader.loadClass(ClassLoader.java:640)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:606)
Java program completed with exit code 1
JAVA CLASS(Test18jn2012) CLASSPATH('/qibm/ProdData/Java400/jdk6')
I get
Exception in thread "main" java.lang.NoClassDefFoundError: Test18jn2012I'm obviously doing something wrong, but WHAT?
Caused by: java.lang.ClassNotFoundException: Test18jn2012
at java.net.URLClassLoader.findClass(URLClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:640)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:606)
Java program completed with exit code 1
--
JHHL
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.