This discussion is archived
4 Replies Latest reply: Jan 4, 2013 11:30 PM by Pan.Tian RSS

javac error on R12.1.1

PVM Newbie
Currently Being Moderated
Hi All,

I have installed an R12.1.1 instance on Linux machine (RHEL 4.7). When i tried to compile a java file its giving error as mentioned below

[  ] javac

Exception in thread "main" java.lang.ClassFormatError: com.sun.tools.javac.main.Main (erroneous method access flags)
*at JvClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0)*
*at JvClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0)*
*at JvClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0)*
*at JvClassReader.parse() (/usr/lib/libgcj.so.5.0.0)*
*at JvDefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0)*
at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0)
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
*at JvFindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)*
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
*at JvBytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)*
*at JvVerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)*
*at JvPrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)*
*at JvWaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)*
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
*at JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)*
*at JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)*
at __libc_start_main (/lib/tls/libc-2.3.4.so)

The output of which java

/u01/applmgr/<inst_name>/apps/tech_st/10.1.3/appsutil/jdk/jre/bin/java

java -version

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode)

gcc -v

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure prefix=/usr mandir=/usr/share/man infodir=/usr/share/info enable-shared enable-threads=posix disable-checking with-system-zlib enable-__cxa_atexit enable-languages=c,c++ disable-libgcj --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)

Please let me know a solution for this.

Thanks,
Manikandan
  • 1. Re: javac error on R12.1.1
    Helios-GunesEROL Oracle ACE
    Currently Being Moderated
    Hi;
    When i tried to compile a java file its giving error as mentioned below
    How you make compile?

    Regard
    Helios
  • 2. Re: javac error on R12.1.1
    PVM Newbie
    Currently Being Moderated
    Hi Helios,

    I am compiling a java file by the following command

    javac  xxWorkOrderRepCO.java


    Exception in thread "main" java.lang.ClassFormatError: com.sun.tools.javac.main.Main (erroneous method access flags)
    at JvClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0)
    at JvClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0)
    at JvClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0)
    at JvClassReader.parse() (/usr/lib/libgcj.so.5.0.0)
    at JvDefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
    at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0)
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
    at JvFindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at JvBytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
    at JvVerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
    at JvPrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at JvWaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
    at JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
    at JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
    at __libc_start_main (/lib/tls/libc-2.3.4.so)


    Thanks,
    Manikandan
  • 3. Re: javac error on R12.1.1
    Helios-GunesEROL Oracle ACE
    Currently Being Moderated
    Hi;

    Please see below note:
    HOW TO COMPILE JAVA FILES IN CRM APPLICATIONS [ID 468434.1]

    Regard
    Helios
  • 4. Re: javac error on R12.1.1
    Pan.Tian Newbie
    Currently Being Moderated
    HOW TO COMPILE JAVA FILES IN CRM APPLICATIONS [ID 468434.1]
    I encounter similar problem, Above note is not suitable for my case, and I found another solution. pasted to here, it could help somebody


    Checking Points

    -bash-3.00$ which javac
    /usr/bin/javac


    -bash-3.00$ which java
    ~/apps/tech_st/10.1.3/appsutil/jdk/jre/bin/java


    -bash-3.00$ java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)


    Solution

    It seems default javac command(/usr/bin/javac) doesn't work fine.

    My solution is,Under directory /local/java/, there are many different version jdk or jre, choose a proper one to compile to your java file,
    My Case:
    +/local/java/jdk1.6.0_17/bin/javac *.java+

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points