Apr 032012
 

리눅스에서 Eclipse와 OpenJDK 1.6 으로 개발한 Executive jar 실행 파일을 Sparc Solaris 10에 들어 있는 Sun의 JDK 1.5 환경에서 실행을 하면 아래와 같은 에러가 발생합니다.

bash-3.00# java -jar StatAgent.jar
Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

당연히 될꺼라고 생각했지만, 컴파일 환경과 실행환경이 중요하더군요.

그래서 Eclipse에서 아래와 같이 설정이 가능합니다.
이렇게 하니깐 JDK 1.6 과 JDK 1.5 환경에서 모두 잘 작동합니다.

Print Friendly

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/smlee/blog/wordpress/wp-content/plugins/seo-facebook-comments/seofacebook.php on line 488

Warning: Invalid argument supplied for foreach() in /home/smlee/blog/wordpress/wp-content/plugins/seo-facebook-comments/seofacebook.php on line 490

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins