#81 Bad major version number in JDK 1.1.8 /2

open
nobody
General (151)
3
2003-06-25
2002-10-02
No

I tried to run bsh-1.2b6.jar with the following .CMD:

@echo off
SetLocal
set
CLASSPATH=F:\Util\Java\BeanShel\bsh-1.2b6.jar;%CLASSP
ATH%
java -verbose %1 %2 %3 %4 %5 %6 %7 %8 %9
endLocal

and bsh.Console (or bsh.Interpreter as arguments).

I get an error "Bad major version number" error (I added
some context before:

[Loaded java/util/Vector.class from
E:\JAVA11\DLL\..\lib\classes.zip]
[Loaded
com/ibm/security12/java/security/ProtectionDomainStore.cl
ass from E:\JAVA11\LIB\SecMa.jar]
[Loaded
com/ibm/security12/java/security/ProtectionDomain.class
from E:\JAVA11\LIB\SecMa.jar]
[Loaded
com/ibm/security12/java/security/AccessControlContext.cla
ss from E:\JAVA11\LIB\SecMa.jar]
[Loaded
com/ibm/security12/java/security/AccessControlContextSe
curityManager.class from E:\JAVA11\LIB\SecMa.jar]
[Loaded DLL 'E:\JAVA11\DLL\..\bin\javaz.dll' (rc = 0 module
handle = 0x144f)]
[Failed to load bsh/Console.class from
F:\Util\Java\BeanShel\bsh-1.2b6.jar for this reason: Bad
major version number]
Can't find class bsh/Console or something it requires

I think that this error is related to compiling with JDK >1.2
and running with 1.1.8. The wesite claims some
compatibility wtih 1.1.
Maybe compiling with -target would help. I have Swing 1.1
and 1.1.1.

This is JDK 1.1.8 on OS/2 Warp 4 Fixpack 15.

Discussion

  • Pat Niemeyer

    Pat Niemeyer - 2003-06-25
    • priority: 5 --> 3
     
  • Pat Niemeyer

    Pat Niemeyer - 2003-06-25

    Logged In: YES
    user_id=18885

    Are there any performance implications using the -target on
    compile? Should I just document that if you wish to use it
    with 1.1 you have to recompile from source or should I use
    the target to compile?

    lowering the priority a bit for now...

     
  • Keita KAWABE

    Keita KAWABE - 2003-12-02

    Logged In: YES
    user_id=582169

    Hi there,
    now I have the same trouble running beanshell with jdk1.1.8
    on Windows (for my own reason, which is explained later), and
    I even cannot build beanshell with javac 1.1.8. I'm quite new to
    java and ant, so any help would be greatly appreciated.

    Details:
    I have both Sun jdk 1.4.2_02 and jdk 1.1.8 on Windows 2000.
    I want to use beanshell with jdk 1.1.8.

    First I tried the binary distribution of bsh-2.0b1. I just
    unpacked
    the binary to some directory, moved to the parent directory of
    bsh and invoked JVM like:

    c:\jdk1.1.8\bin\java -classpath
    "c:\jdk1.1.8\lib\classes.zip;.\" bsh.Interpreter

    and got the error message:
    Error loading class bsh/Interpreter: Bad major version number

    OK, so I tried to recompile everything using javac in
    jdk1.4.2_02,
    but with "classic" javac. I grabbed the source of bsh-2.0b1,
    added
    the following line in build.xml
    compiler="classic"
    after the "<javac srcdir= blabla" line, uncommented
    "exclude-1.1"
    "exclude-bsf" and "exclude-servlet". I set the environment
    variables
    JAVA_HOME and PATH so that ant can find the correct jdk.
    set JAVA_HOME= C:\local\j2sdk1.4.2_02
    set PATH=C:\local\j2sdk1.4.2_02\bin;C:\local\ant\bin

    Then I run apache-ant 1.5.4:

    ant

    Together with a bunch of warnings concerning deprecated methods,
    I got the following warning which I think is important:

    [javac] This version of java does not support the classic
    compiler;
    upgrading to modern

    The build went OK, but apparently the binary is still in
    "modern"
    binary format, and I still got the same "bad major version
    number"
    error. (FYI, it was possible to use the generated binary with
    jdk1.4.2_02.)

    Then I tried to use javac in jdk1.1.8. I haven't changed
    build.xml
    (meaning the "classic" thing is still there). I simply
    changed the
    environment variables JAVA_HOME and PATH so that ant can now
    use jdk1.1.8 instead of jdk1.4.2:
    set JAVA_HOME= C:\jdk1.1.8
    set PATH=C:\jdk1.1.8\bin;C:\local\ant\bin

    When I invoked ant, I got tons of errors (you can see them at
    the end of this report). I'm not a java expert, and I'm not
    familiar
    with ant either. I think I'm completely lost. Would you
    please tell
    me the right direction to go?

    Cheers,
    Keita

    Appendix 1. Why I want to use jdk1.1.8
    Basically, I want to use beanshell on pjava 1.2 on a handheld.
    Pjava1.2 is roughly an equivalent of jdk1.1.8 with some specific
    add-on library. Since it's the embedded device, upgrading to,
    say, j2me is not an option; I'm not in a position to tell the
    manufacturer which JVM they should ship.

    I'm trying to use beanshell on PC with jdk1.1.8 simply because
    my development platform is mainly PC. The debugging feature of
    the device itself is quite limited (i.e. none).

    Appendix 2. The error messages when using jdk1.1.8 for
    building beanshell

    C:\intent\Beanshell> ant
    A nonfatal internal JIT (3.00.072b(x)) error 'chgTarg:
    Conditional' has occurred in :
    'org/apache/tools/ant/Project.fireMessageLoggedEvent
    (Lorg/apache/tools/ant/BuildEvent;Ljava/lang/String;I)V':
    Interpreting method.
    Please report this error in detail to
    http://java.sun.com/cgi-bin/bugreport.cgi

    A nonfatal internal JIT (3.00.072b(x)) error 'chgTarg:
    Conditional' has occurred in :
    'org/apache/tools/ant/Project.addCreatedTask
    (Ljava/lang/String;Lorg/apache/tools/ant/Task;)V':
    Interpreting method.
    Please report this error in detail to
    http://java.sun.com/cgi-bin/bugreport.cgi

    Buildfile: build.xml

    checkjjt:

    jjtree:

    checkjj:

    javacc:

    builddir:

    compile:
    [javac] Compiling 123 source files to
    C:\intent\BeanShell\classes
    [javac] C:\intent\BeanShell\src\bsh\XThis.java:38: Class
    java.lang.reflect.InvocationHandler not found in import.
    [javac] import java.lang.reflect.InvocationHandler;
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\XThis.java:125:
    Interface java.lang.reflect.InvocationHandler of inner class
    bsh.XThis. Handler not found.
    [javac] class Handler implements InvocationHandler,
    java.io.Serializable
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionIterator.java:3:
    Class java.util.Iterator not found in import.
    [javac] import java.util.Iterator;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionIterator.java:4:
    Class java.util.Collection not found in import.
    [javac] import java.util.Collection;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:36:
    Class java.util.Iterator not found in import.
    [javac] import java.util.Iterator;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:37:
    Class java.util.Collection not found in import.
    [javac] import java.util.Collection;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:39:
    Class java.util.Map not found in import.
    [javac] import java.util.Map;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorUtil.java:38:
    Class java.util.ArrayList not found in import.
    [javac] import java.util.ArrayList;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorUtil.java:39:
    Class java.util.List not found in import.
    [javac] import java.util.List;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\Interpreter.java:1031: Note: The
    constructor java.io.PrintStream(java.io.OutputStream) has
    been deprecated.
    [javac] PrintStream pout = new PrintStream(
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:844:
    Method remove(java.lang.String) not found in class
    java.util.Vector.
    [javac] importedPackages.remove( name );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:873:
    Method remove(java.lang.String) not found in class
    java.util.Vector.
    [javac] importedCommands.remove( name );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:1505:
    Method remove(java.lang.Object) not found in class
    java.util.Vector.
    [javac] importedObjects.remove( obj );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:1521:
    Method remove(java.lang.Class) not found in class
    java.util.Vector.
    [javac] importedStatic.remove( clas );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\Reflect.java:489:
    Method add(java.lang.reflect.Method) not found in class
    java.util.Vector.
    [javac] mv.add( m[i] );
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorImpl.java:173:
    Class java.util.List not found in type declaration.
    [javac] List vars = new ArrayList();
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorImpl.java:173:
    Class java.util.ArrayList not found in type declaration.
    [javac] List vars = new ArrayList();
    [javac] ^
    [javac] Note:
    C:\intent\BeanShell\src\bsh\Interpreter.java uses a
    deprecated API. Please consult the documentation for a
    better alternative.
    [javac] 16 errors, 2 warnings

    BUILD FAILED
    file:c:/intent/BeanShe
    utput for details.

    Total time: 9 seconds

     
  • Keita KAWABE

    Keita KAWABE - 2003-12-02

    Logged In: YES
    user_id=582169

    Hi there,
    now I have the same trouble running beanshell with jdk1.1.8
    on Windows (for my own reason, which is explained later), and
    I even cannot build beanshell with javac 1.1.8. I'm quite new to
    java and ant, so any help would be greatly appreciated.

    Details:
    I have both Sun jdk 1.4.2_02 and jdk 1.1.8 on Windows 2000.
    I want to use beanshell with jdk 1.1.8.

    First I tried the binary distribution of bsh-2.0b1. I just
    unpacked
    the binary to some directory, moved to the parent directory of
    bsh and invoked JVM like:

    c:\jdk1.1.8\bin\java -classpath
    "c:\jdk1.1.8\lib\classes.zip;.\" bsh.Interpreter

    and got the error message:
    Error loading class bsh/Interpreter: Bad major version number

    OK, so I tried to recompile everything using javac in
    jdk1.4.2_02,
    but with "classic" javac. I grabbed the source of bsh-2.0b1,
    added
    the following line in build.xml
    compiler="classic"
    after the "<javac srcdir= blabla" line, uncommented
    "exclude-1.1"
    "exclude-bsf" and "exclude-servlet". I set the environment
    variables
    JAVA_HOME and PATH so that ant can find the correct jdk.
    set JAVA_HOME= C:\local\j2sdk1.4.2_02
    set PATH=C:\local\j2sdk1.4.2_02\bin;C:\local\ant\bin

    Then I run apache-ant 1.5.4:

    ant

    Together with a bunch of warnings concerning deprecated methods,
    I got the following warning which I think is important:

    [javac] This version of java does not support the classic
    compiler;
    upgrading to modern

    The build went OK, but apparently the binary is still in
    "modern"
    binary format, and I still got the same "bad major version
    number"
    error. (FYI, it was possible to use the generated binary with
    jdk1.4.2_02.)

    Then I tried to use javac in jdk1.1.8. I haven't changed
    build.xml
    (meaning the "classic" thing is still there). I simply
    changed the
    environment variables JAVA_HOME and PATH so that ant can now
    use jdk1.1.8 instead of jdk1.4.2:
    set JAVA_HOME= C:\jdk1.1.8
    set PATH=C:\jdk1.1.8\bin;C:\local\ant\bin

    When I invoked ant, I got tons of errors (you can see them at
    the end of this report). I'm not a java expert, and I'm not
    familiar
    with ant either. I think I'm completely lost. Would you
    please tell
    me the right direction to go?

    Cheers,
    Keita

    Appendix 1. Why I want to use jdk1.1.8
    Basically, I want to use beanshell on pjava 1.2 on a handheld.
    Pjava1.2 is roughly an equivalent of jdk1.1.8 with some specific
    add-on library. Since it's the embedded device, upgrading to,
    say, j2me is not an option; I'm not in a position to tell the
    manufacturer which JVM they should ship.

    I'm trying to use beanshell on PC with jdk1.1.8 simply because
    my development platform is mainly PC. The debugging feature of
    the device itself is quite limited (i.e. none).

    Appendix 2. The error messages when using jdk1.1.8 for
    building beanshell

    C:\intent\Beanshell> ant
    A nonfatal internal JIT (3.00.072b(x)) error 'chgTarg:
    Conditional' has occurred in :
    'org/apache/tools/ant/Project.fireMessageLoggedEvent
    (Lorg/apache/tools/ant/BuildEvent;Ljava/lang/String;I)V':
    Interpreting method.
    Please report this error in detail to
    http://java.sun.com/cgi-bin/bugreport.cgi

    A nonfatal internal JIT (3.00.072b(x)) error 'chgTarg:
    Conditional' has occurred in :
    'org/apache/tools/ant/Project.addCreatedTask
    (Ljava/lang/String;Lorg/apache/tools/ant/Task;)V':
    Interpreting method.
    Please report this error in detail to
    http://java.sun.com/cgi-bin/bugreport.cgi

    Buildfile: build.xml

    checkjjt:

    jjtree:

    checkjj:

    javacc:

    builddir:

    compile:
    [javac] Compiling 123 source files to
    C:\intent\BeanShell\classes
    [javac] C:\intent\BeanShell\src\bsh\XThis.java:38: Class
    java.lang.reflect.InvocationHandler not found in import.
    [javac] import java.lang.reflect.InvocationHandler;
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\XThis.java:125:
    Interface java.lang.reflect.InvocationHandler of inner class
    bsh.XThis. Handler not found.
    [javac] class Handler implements InvocationHandler,
    java.io.Serializable
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionIterator.java:3:
    Class java.util.Iterator not found in import.
    [javac] import java.util.Iterator;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionIterator.java:4:
    Class java.util.Collection not found in import.
    [javac] import java.util.Collection;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:36:
    Class java.util.Iterator not found in import.
    [javac] import java.util.Iterator;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:37:
    Class java.util.Collection not found in import.
    [javac] import java.util.Collection;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\collection\CollectionManagerImpl.java:39:
    Class java.util.Map not found in import.
    [javac] import java.util.Map;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorUtil.java:38:
    Class java.util.ArrayList not found in import.
    [javac] import java.util.ArrayList;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorUtil.java:39:
    Class java.util.List not found in import.
    [javac] import java.util.List;
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\Interpreter.java:1031: Note: The
    constructor java.io.PrintStream(java.io.OutputStream) has
    been deprecated.
    [javac] PrintStream pout = new PrintStream(
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:844:
    Method remove(java.lang.String) not found in class
    java.util.Vector.
    [javac] importedPackages.remove( name );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:873:
    Method remove(java.lang.String) not found in class
    java.util.Vector.
    [javac] importedCommands.remove( name );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:1505:
    Method remove(java.lang.Object) not found in class
    java.util.Vector.
    [javac] importedObjects.remove( obj );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\NameSpace.java:1521:
    Method remove(java.lang.Class) not found in class
    java.util.Vector.
    [javac] importedStatic.remove( clas );
    [javac] ^
    [javac] C:\intent\BeanShell\src\bsh\Reflect.java:489:
    Method add(java.lang.reflect.Method) not found in class
    java.util.Vector.
    [javac] mv.add( m[i] );
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorImpl.java:173:
    Class java.util.List not found in type declaration.
    [javac] List vars = new ArrayList();
    [javac] ^
    [javac]
    C:\intent\BeanShell\src\bsh\ClassGeneratorImpl.java:173:
    Class java.util.ArrayList not found in type declaration.
    [javac] List vars = new ArrayList();
    [javac] ^
    [javac] Note:
    C:\intent\BeanShell\src\bsh\Interpreter.java uses a
    deprecated API. Please consult the documentation for a
    better alternative.
    [javac] 16 errors, 2 warnings

    BUILD FAILED
    file:c:/intent/BeanShe
    utput for details.

    Total time: 9 seconds

     

Log in to post a comment.