Getting version error...

I am trying to compile the following code :
import javax.ejb.*;
public class HelloBean implements SessionBean
        public void ejbCreate() {}
        public void ejbActivate() {}
        public void ejbPassivate() {}
        public void ejbRemove() {}     
        public void setSessionContext(SessionContext sc){}
        public String sayHello ()
                System.out.println ("Someone called sayHello()");
                return "Hello! World";
}But when i try to compile this piece of code, i am getting following error :
HelloBean.java:5: cannot access javax.ejb.SessionBean
bad class file: C:\java_addons\ejb_api\ejb-3_0-api.jar(javax/ejb/SessionBean.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class HelloBean implements SessionBean
                                  ^
1 errorI have set classpath for ejb-3_0-api.jar
I was also getting the same error when i tried some code with JAXP package.
I am using JDK 1.4
Can anyone help me in sorting out this problem?

If your machine is using 1.4 for a compiler it would generate version 48.0 classfiles. Version 49.0 is generated only by the 1.5 compiler.
It is quite possible to have versions mixed up by that. System path settings can easily cause that.
Check your Windows and Windows/System directories for example, there could well be java.exe and javaw.exe executables in there. Older JVMs installed those to be "helpful" so people didn't have to mess with their path settings, but new ones don't (and some uninstallers forgot to remove them).
Delete those 2 files if you find them and you should have the same compiler and runtime versions again (the Windows directories have higher priority than any other on the system path, so files there get taken even if files elsewhere exist on the path that are found earlier).
On Unix systems similar things can happen.

Similar Messages

Maybe you are looking for

  • ORA-1403  No Data Found

    I have some PL/SQL code that looks like this: PROCEDURE my_proc(start_date DATE, end_date DATE) AS BEGIN   FOR rec IN (SELECT DISTINCT column1               FROM my_table               WHERE test_date_and_time BETWEEN start_date AND end_date;)   LOOP

  • Adding a new field to a standard webdynpro component's layout

    Hi all,   I need to add a new field to a standard webdynpro component's( in my case the component is ''/SAPSRM/WDC_UI_SC_DOTC_BD')  layout.How do i go about adding a new field to the standard component's lay out? can anyone help me with the necessary

  • How do I remove the file ID from the file name of an an uploaded File?

    Hello, Im uploading/downloading files in my application (apex 4.0), and it working great, however, the filename that appears has the file id I believe attached to it, ex: F1903848613/my_test_file.txt Im figuring I need to use some kind of combination

  • How to edit pdfs when you keep getting error message (14)

    How to edit pdfs - I have a pdf I created to make a certificate - I am naturally trying to edit that for another person - ALL of these keep giving me the same message - error reading this (14).  Even when I DO manage to get one to open and let me edi

  • Open two Forms  Connecting Two different Data bases

    In The Same Company Two Different Places Open Same SAPB1 Application Connecting with Two different DataBases,Open both two forms same time.