eclipse compile and run using JDK and JRE level issues - on the "Bad version number in. class file" exception solution

2011-01-09  来源:本站原创  分类:Java  人气:187 

Eclipse today to help a friend run a simulation program, encountered "Bad version number in. Class file" exception. Means "the wrong version number." I had previously encountered a similar problem, here restructure.

This is because Java programs compiled in eclipse to use when running JDK version higher than the JRE version used due. If compiled with jdk1.6, the runtime jre 1.5 version. In the 1.5 version of the runtime environment running on the 1.6 program, of course not. But can, in turn, because software usually has the so-called "backward compatibility."

Specific solutions set in the eclipse compiler-level JDK: Window -> Preference -> Java -> Compiler, set the compiler compliance level (this corresponds to 5.0 jdk1.5, 6.0 corresponds to jdk1.6); set JRE version : Window -> Preference -> Java, choose a jre on the line (mine is D: \ jdk1.6, used here is included in the jdk jre). Just make sure the former (JDK) version number is less than or equal to the latter (JRE) version number on it.

相关文章
  • eclipse compile and run using JDK and JRE level issues - on the "Bad version number in. class file" exception solution 2011-01-09

    Eclipse today to help a friend run a simulation program, encountered "Bad version number in. Class file" exception. Means "the wrong version number." I had previously encountered a similar problem, here restructure. This is because Jav

  • eclipse plugin using svn status icon The version number can not be displayed solution 2011-08-24

    Using svn eclipse plugin, the original normal, without any changes, suddenly one day, eclipse view the file, the file behind the version number, status of the file icon, and so on are gone. Check the plug-in, update, submit and other operations can b

  • JAR package eclipse hit and run 2010-12-02

    -------------------------------- Jar package using eclipse to play Note: 1, select the package works, just select the src. Select Export generated class files and resources. Select the Compress the contents of the JAR file. Select the Overwrite exist

  • jdk and jre adjusting the boot sequence when co-existence 2010-07-28

    jdk and jre adjust the boot sequence when co-existence Tips must be compiled with maven jdk. After installing jre how to use Eclipse runtime jdk not jre it? Install jre, in C: \ WINDOWS \ system32 place a java.exe C: \ WINDOWS \ system32 in the windo

  • JDK (SDK) JRE JVM instructions 2010-07-09

    SDK (Software Develop Kit, Software Development Kit), to help developers increase productivity. Different types of software development, can have their own SDK. Windows with Windows SDK, DirectX with DirectX 9 SDK,. NET developers have Microsoft. NET

  • the difference between jdk and jre 2010-07-19

    For java beginners often do not understand the difference between distinction between jdk and jre in fact two very different things, it is necessary to find out: Simply put, JDK is used for the developer SDK, which provides Java development environme

  • What is the jdk and jre? What's the use? (Reprint) 2010-08-04

    We certainly have the time to install JDK to choose whether to install a separate jre, usually with the installation, I recommend you do so. Because it can better help you figure out the difference between them: Jre is the java runtime environment, i

  • Android NDK-r4 sample - compile and run (II) 2011-01-11

    Compile and run the sample in the HelloJni hello-jni example is to show how a simple Android application using JNI example. This example function is to accept a string from C programs and displays. Description: <ndk-root> is my decompression ndk-r4

  • JDK和JRE的区别 2012-03-08

    原文:http://www.cnblogs.com/myitm/archive/2011/05/03/2035942.html JDK就是Java Development Kit.简单的说JDK是面向开发人员使用的SDK,它提供了Java的开发环境和运行环境.SDK是Software Development Kit 一般指软件开发包,可以包括函数库.编译程序等. JRE是Java Runtime Enviroment是指Java的运行环境,是面向Java程序的使用者,而不是开发者. 如果安装了J

  • jdk与jre的区别 2014-05-21

    JDK就是Java Development Kit.简单的说JDK是面向开发人员使用的SDK,它提供了Java的开发环境和运行环境. SDK是Software Development Kit 一般指软件开发包,可以包括函数库.编译程序等. JRE是Java Runtime Enviroment是指Java的运行环境,是面向Java程序的使用者,而不是开发者. 如果安装了JDK,会发同你的电脑有两套JRE,一套位于 \jre 另外一套位于 C:\Program Files\Java\jre1.5.

  • Simply compile and run under the linux C program 2010-06-22

    hello.c # Include int main (void) ( printf ("Hello world, Linux programming! \ \ n"); return 0; ) And then execute the following command to compile and run this program: # Gcc hello.c-o hello #. / Hello Hello world, Linux programming! . / Initia

  • cygwin compile and run the mysql record 2010-09-08

    Transfer from http://www13.atwiki.jp/uhaku/pages/51.html Slightly changed a bit, compile and run mysql5.1 code 1. Install cygwin and the ncurses library http://www.cygwin.com/setup.exe Install from Internet Set directory and spool directory go after

  • Chapter VI erlang programming compile and run 2010-10-11

    Compile and run the translator: gashero Directory ? A start and stop the Erlang shell ? 2 modify the development environment ? 2.1 set the search path of loader code ? 2.2 in the system startup sequence of commands ? 3 other ways to run the program ?

  • How to compile and run the command line mode with a package of java files 2010-12-13

    Suppose two files: D: \ workspace \ com \ A.java D: \ workspace \ com \ B.java Two files are: package com; How to compile and run? Enter D: \ workspace path, enter: javac com \ A.java com \ B.java-d. Red as the source file path, blue is the output pa

  • jdk与jre的区别 很形象,很清晰,通俗易懂 2013-11-14

    对于java初学者来说,往往不懂区分jdk和jre的区别,实际上这两个东西差别很大的,有必要了解一下 简单的说JDK是面向开发人员使用的SDK,它提供了Java的开发环境和运行环境.SDK是Software Development Kit 一般指软件开发包,可以包括函数库.编译程序等. JDK就是Java Development Kit JRE是Java Runtime Enviroment是指Java的运行环境,是面向Java程序的使用者,而不是开发者. 如果安装了JDK,会发同你的电脑有两套

  • JDK后JRE.JVM之间的关系是什么 2013-06-10

    安装JDK后JRE.JVM之间的关系是什么呢?那么我们要从安装JDK慢慢说起. 如果安装了JDK,会发同你的电脑有两套JRE: 一套位于 <JDK安装目录>\jre 另外一套位于 C:\Program Files\Java\j2re1.4.1_01 目录下 后面这套比前面那套少了Server端的Java虚拟机,不过直接将前面那套的Server端Java虚拟机复制过来就行了.而且在安装JDK可以选择是否安装这个位于 C:\Program Files\Java 目录下的JRE. 如果你只安装JRE

  • JDK and Tomcat Lane tools.jar inside lib version to be consistent under the tools.jar 2010-03-25

    JDK and Tomcat Lane tools.jar inside lib version to be consistent under the tools.jar TOMCAT5.0 at run time by the emergence of the following errors: 2005-11-17 19:38:47 StandardWrapperValve [action]: Servlet.service () for servlet action threw excep

  • After installation LoadRunner8.1 run Mercury Web Tours Application, click on the right side of the blank during flights, the solution 2010-09-03

    Note: The following on-line collection! ! ! After installation LoadRunner8.1 run Mercury Web Tours Application, click on the right side of the blank during flights, the solution View log files under the installation directory, (Catalog D: \ Program F

  • Eclipse下Java compiler level does not match the version of the installed Java project facet的问题 2012-03-09

    问题现象:项目图标报错"Java compiler level does not match the version of the installed Java project facet.". 分析原因:根据错误信息的字面意思,应该是Java版本设定不一致的问题.而且这个Java版本跟Project安装的有关系. 解决办法: 既然是project出的问题,自然要从项目属性入手.其实很简单, 右键项目"Properties",在弹出的"Properties

  • grails Eclipse can not run into problems 2008-06-06

    grails create a project into Eclipse, the Eclipse Run in the start, and sometimes can not run, and report the following error: java.lang.NoClassDefFoundError: and Exception in thread "main" This is a need to modify the operating parameters, Argu