Skip to main content

Java Compilation Error


public class SimpleJava {
  
   public void showMessage() {
      System.out.println("Here we are");
   }
}   

Ran into this small little problem when compiling java to use in an Oracle procedure.
ORA-29516: Aurora assertion failure: Assertion failure at eox.c:359 Uncaught exception System error: java/lang/UnsupportedClassVersionError

I could understand that I had somehow compiled the class using an incorrect version but seeing as I had done this from the server I thought I would have been OK. A bit of digging and I came up with the following:

Find the version the class was actually compiled in:
javap -verbose SimpleJava
This gave the following output along with some other info:
public class SimpleJava extends java.lang.Object
SourceFile: "SimpleJava.java"
minor version: 0
major version: 50
Table of versions:
major  minor Java platform version 
45       3           1.0
45       3           1.1
46       0           1.2
47       0           1.3
48       0           1.4
49       0           1.5
50       0           1.6

Using the above table I could see that I had compiled it with 1.6. But how had this happened as I had used the server to compile the java file? Well I had missed a crutial point, the database and application aren't on the same server and in this case the database server is running an eariler Java version. I checked it using this:
java -version
Output: 
java version "1.4.2"

So my problem was that I was compiling on the Application server using a higher version than the one on the database. Solution:
javac -source 1.4  -target 1.4 SimpleJava.java

Using just the -target 1.4 did not solve the problem completely.

Source

Comments

  1. im getting error while compiling java code which have servelet packages.

    the some errors are package javax.servlet does not exist

    im using tomcat.i hav set the classpath for servelet-api.jar file.still getting the errors.
    can u help me rectify the errors

    ReplyDelete

Post a Comment

Popular posts from this blog

Cancel or abort adop session

ADOP is in my opinion still pretty half baked. This is a critical tool that just isn't as intuitive as the old adpatch was. However we move with the times and get the hang of the new way of doing things. Along the way you might want to abort or cancel a patching cycling. With the two file systems and db editioning this can be a bit more to manage. I have learnt the hard way so you need to use the full cleanup after aborting a session. adop phase=abort adop phase=cleanup cleanup_mode=full

Launching a Concurrent with Form Personalization on EBS 11i

There are two methods when it comes to running a concurrent from a Form Personalization in Oracle. The thing you need to do in either case is create a menu option for the form in question. This is generally done on a WHEN-NEW-FORM-INSTANCE Trigger Event. If you already have an event like this then you can add it there. I personally like to group my customizations together so there is not much overlap. Whichever catches your fancy will work. Setup the menu with the name: You now have a menu item for the launching of the concurrent program. This is where the two methods separate and you may choose which ever is more appropriate to you. Launch FNDRSRUN (Submit Request) This will use the zoom feature of Oracle Form Personalization to open the Submit Request Form, and pass the parameters to it. This involves personalization in two forms. The sending form needs to call the Form Function and pass the parameters and the Submit Request form needs to receive and process those parameters....

Creating new WLS domain ends with exit code 255

Cloning the instance I ran into this weird error. Was not sure what to do but after learning my lesson I dug through the error logs after seeing this in the adcfgclone log file. START: Creating new WLS domain. Running /u03/APPLYES/YES/fs2/FMW_Home/oracle_common/bin/pasteConfig.sh -javaHome /u03/APPLYES/YES/fs2/EBSapps/comn/util/jdk64 -al /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/WLS/EBSdomain.jar -tdl /u03/APPLYES/YES/fs2/FMW_Home/user_projects/domains/EBS_domain_YES -tmw /u03/APPLYES/YES/fs2/FMW_Home -mpl /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/WLS/plan/moveplan.xml -ldl /u03/APPLYES/YES/fs2/inst/apps/YES_erpapyes/admin/log/clone/wlsT2PApply -silent true -debug true -domainAdminPassword /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/tempinfo.txt Script Executed in 1903 milliseconds, returning status 255 ERROR: Script failed, exit code 255 Dig a bit deeper into the log files cd /u03/APPLYES/YES/fs2/inst/apps/YES_erpapyes/admin/log/clone/wlsT2PApply cat CLONE2016-01-10_04-37-...