Unsupported class???

Hi,
I tried to run the a java file but failed. The error message that I get:-
java ExampleProgram
The java class could not be loaded. java.lang.UnsupportedClassVersionError: ExampleProgram (Unsupported major.minor version 49.0)
and this is my java file:-
class ExampleProgram {
public static void main(String[] args){
System.out.println("I'm a Simple Program");
BTW, I'm using linux and installed jdk-1.5_0_06.
Hope you guys can help me. Thanks.

The command java -version returns this...
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition
(build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM build
cxia321420-20040626 (JIT enabled: jitc))
I dont what is the error, but i think i've already
installed the jdk-1.5. Do I need to set the path
first? Or I had to uninstall the IBm one?your problem is you are compiling with a different version of java then you are running with.
you've got two installations; remove one (i guess the ibm one) and be happy. otherwise; clean up your "PATH" variable so it only contains the /bin/dir of ONE of the versions, and then all will be good as well.
have fun!

Similar Messages

  • Java card - Unsupported class file format

    Friends,
    when im converting my class file to CAP file, im getting the message that "unsupported class file format of version 49.0". Can any one please help me out.
    Thank you,
    Harshavardhan

    but in the pre Requisites of Installing, its mentioned that "The supported SDK version is 1.4.1. ". and im using 1.5.0. So i need to use only 1.4.1 or earliar versions?

  • Unsupported class file format of version 48.0.

    Hi,
    I am new to Java Card. I have a problem to convert a class file to cap file. When I try to convert it, I got this message " unsupported class file format of version 48.0." Do you guys know any idea about it?

    The class file version is determined by the used java compiler (javac).
    The old Java Card development kit 2.1.2 was designed to work only with javac of the jsdk1.3 the current development kit 2.2.1 needs jsdk 1.4.
    In both cases you can not use jdk1.5 for compiling you java files.
    Jan

  • Unsupported class version error trying to run jar file on windows machine

    Hi,
    i've written a program that connects to an access database to get its data. Created a jar file with the class files, the access database and other required files.
    works fine on my home windows computer but when i try to run it on another machine i get an error.
    here's what i write on the cmd: java -Xmx128m -jar myFile.jar
    heres the error i get:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: StartUp(Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    and so on.
    It seems like it might be quite a basic error but i'm lost, can anyone please shed some light and tell me where i'm going wrong?
    cheers in advance

    hey there, in case anyone was going to reply, i've worked it out now. couldn't work out what was wrong at first so just pulled out all my classes and put them into a brand new jar file. now use javaw -jar instead of java and it worked fine! wierd...

  • Unsupported class version error

    I'm trying to run the "Hello World" example in the "Integrating Native Code Into Java" tutorial. When I try to run the program, this is the error message I get:
    java MainException in thread "main" java.lang.UnsupportedClassVersionError: Main (Unsupported major.minor version 50.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Any idea what I might be doing wrong? I'm on a SUSE Linux box.
    thanks
    David

    Here's an update:
    I was invoking the wrong Java runtime before. Now that I have the correct one, here's the error message I get:
    java Main
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no hello in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at HelloWorld.<clinit>(HW.java:7)
    at Main.main(Main.java:5)
    I have a "hello" C program in the same directory as Main.class, named libhello.so
    Do I need to set java.library.path some way?
    thanks
    David

  • Getting ServletException & Unsupported Class Version Error in Tomcat6.0

    Hello everyone,
    I have an application which is developed using J2EE technology (servlet, jsp and bean) in Jdeveloper 11g. I have created my own configuration file and then replaced the existing jar with the xml file which i have created. Complied using JRockit R27 1.6. When I deploy the war file in my machine, the application works perfectly. I deployed it in Tomcat 6.0.
    But when i deploy the war file in another machine and then when running the application I get the below two errors.
    1) javax.servlet ServletException : Oracle Coherence 3.5.1 /461 : Servlet initialization encountered an exception while initialization
    2) Root cause is java.lang.unsupportedClassversionError: Bad version number in .class file (Unable to load class com.list.cacheclass)
    I complied all the java files using JRockit.
    I am unable to figure out the problem. PLz provide me a solution for it.
    Thanks,
    Mitraa SP

    Hi Mitraa,
    This just indicates you have mixed java compilation units - possibly the version of java you are compiling against is greater than the version you are running under Tomcat. Either cross-compile (target=1.5) or get the java environments in sync.

  • Error while converting class file to exp and jca file

    error while converting *.class file to *.exp and *.jca file
    =====================================================================================================================
    linux-y60u:/home/admin/java_card_kit-2_2_1/samples/src # converter -exportpath "/home/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/HelloWorld 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/HelloWorld.class
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/Identity.class
    error: com.sun.javacard.samples.HelloWorld.HelloWorld: unsupported class file format of version 50.0.
    error: com.sun.javacard.samples.HelloWorld.Identity: unsupported class file format of version 50.0.
    conversion completed with 2 errors and 0 warnings.
    =====================================================================================================================

    i compile a file javacard use this command:
    ===
    javac -source 1.3 -target 1.1 -g -classpath ./classes:../lib/api.jar:../lib/installer.jar src/com/sun/javacard/samples/Identity/Identity.java
    ===
    and try to convert this class use this command
    ===
    /home/xnuxerx/admin/java_card_kit-2_2_1/bin/converter -exportpath "/home/xnuxerx/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/Identity 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    ===
    result convert:
    ===
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/xnuxerx/admin/java_card_kit-2_2_1/samples/classes/com/sun/javacard/samples/Identity/Identity.class
    converting com.sun.javacard.samples.Identity.Identity
    error: export file framework.exp of package javacard.framework not found.
    conversion completed with 1 errors and 0 warnings.
    ===
    why ??
    please your comment for this problem.
    thank 4 all.

  • How to create a ActiveX Object with custom classes

    Hi
    I am trying to create a Active X object for some of the work I have done in Java to be used with VB, but I cannot get the Active X object to generate and it always come up with the following error:
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: uk/co/agena/minerva/model/Model
    at java.lang.Class.getMethods0(Native Method)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at java.beans.Introspector$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
    at java.beans.Introspector.getTargetEventInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at sun.beanbox.JarInfo.<init>(Unknown Source)
    at sun.beanbox.JarLoader.createJarInfo(Unknown Source)
    at sun.beanbox.JarLoader.loadJar(Unknown Source)
    at sun.beans.ole.Packager.loadBean(Unknown Source)
    at sun.beans.ole.Packager.generate(Unknown Source)
    at sun.beans.ole.Packager.actionPerformed(Unknown Source)
    at java.awt.Button.processActionEvent(Unknown Source)
    at java.awt.Button.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForComponent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForComponent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    This appears to be beacuse the class uk/co/agena/minerva/model/Model is a custom class which is based on the software I am using. Does anyone know how I can get around this issue. I have tried incluijng those class files for the custom classes within the jar file, but I continue to get the same issue?
    Any help would be gratefully received.
    Thanks
    Angie

    This error is no longer coming up, it is now saying that it has an unsupported class version error. I believe this may be because the class file and library files have been complied under different versions, is there a method to check this?

  • Strange problem when tried to convert HelloWorld.class..

    Hi friends..
    i've downloaded the Java Card SDK 2.2.1, and i tried to compile HelloWorld application that shipped with its distribution..
    i found strange problem when i tried to convert HelloWorld.class into .CAP, etc.. :(
    I use Windows XP, assume that i've set the Environment Variables needed
    i've compiled the HelloWorld.java into HelloWorld.class..
    the package of of HelloWorld is : com.sun.javacard.samples.HelloWorld;
    and i use this config file :
    -out EXP JCA CAP
    -exportpath .
    -applet  0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 com.sun.javacard.samples.HelloWorld.HelloWorld
    com.sun.javacard.samples.HelloWorld
    0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0and then i tried to run converter script in the Console :
    *C:\java_card_kit-2_2_1\samples>converter -config com\sun\javacard\samples\HelloWorld\HelloWorld.opt*
    *error: file com\sun\javacard\samples\HelloWorld\HelloWorld.opt could not be found*
    Usage:  converter  <options>  package_name  package_aid  major_version.minor_ve
    sion
    OR
    converter -config <filename>
                        use file for all options and parameters to converter
    Where options include:
            -classdir <the root directory of the class hierarchy>
                          set the root directory where the Converter
                          will look for classes
            -i            support the 32-bit integer type
            -exportpath  <list of directories>
                          list the root directories where the Converter
                          will look for export files
            -exportmap    use the token mapping from the pre-defined export
                          file of the package being converted. The converter
                          will look for the export file in the exportpath
            -applet <AID class_name>
                          set the applet AID and the class that defines the
                          install method for the applet
            -d <the root directory for output>
            -out  [CAP] [EXP] [JCA]
                          tell the Converter to output the CAP file,
                          and/or the JCA file, and/or the export file
            -V, -version  print the Converter version string
            -v, -verbose  enable verbose output
            -help         print out this message
            -nowarn       instruct the Converter to not report warning messages
            -mask         indicate this package is for mask, so restrictions on
                          native methods are relaxed
            -debug        enable generation of debugging information
            -nobanner     suppress all standard output messages
            -noverify     turn off verification. Verification is defaultPlease help me regarding this, because i'm new in this field..
    Thanks in advance..

    Thanks safarmer for your reply..
    i tried this :
    C:\java_card_kit-2_2_1\samples>javac -target 1.3 -source 1.1 -g -classpath .\cla
    sses;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld
    \*.java
    javac: invalid source release: 1.1
    Usage: javac <options> <source files>
    use -help for a list of possible options
    C:\java_card_kit-2_2_1\samples>javac -target 1.3 -source 1.2 -g -classpath .\cla
    sses;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld
    \*.java
    it seems that i can't specify the -source to 1.1, so i tried to use -source 1.2..
    after that, i tried to convert again, and i got this error :
    C:\java_card_kit-2_2_1\samples\src>converter -config com\sun\javacard\samples\He
    lloWorld\HelloWorld.opt
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to lic
    ense terms.
    error: com.sun.javacard.samples.HelloWorld.HelloWorld: unsupported class file fo
    rmat of version 47.0.
    conversion completed with 1 errors and 0 warnings.Please help me regarding this..
    Thanks in advance..

  • Error while compile .Java to .class

    I am new in java card. I have some problem when compile java card applet.
    1. I installed j2sdk1.4.2_07 and java_card_kit- 2_2_2 to build a sample java card. I set the environment as:
    @echo off
    set JC_HOME=C:\java_card_kit-2_2_2-windows\java_card_kit-2_2_2
    set JAVA_HOME=c:\j2sdk1.4.2_07
    set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%
    I created a java applet and saved in C\STCard, and I use windows command to compile, the command is:
    c:\java_card_kit-2_2_2-windows\java_card_kit-2_2_2\samples>javac -g -classpath c:\STCard;..\lib\api.jar;..lib\installer.jar c:\STCard\*.java
    but the error is: "cannot access javacard.framework.APDU"
    What am I wrong?
    2. I use eclipse 3.3.2, eclipse jcde 0.1, java_card_kit-2_2_2, jdk1.6.0 to compile java card applet. The compilation from .java to .class was no problem, but from the .class to .cap has problem:
    java com.sun.javacard.converter.Converter -config .\converter2.opt
    error: stcard.STCard: unsupported class file format of version 50.0.
    What should I do to convert from .class to .cap?
    Thx all

    I have a typically problem , I am a student and learning core java am just a beggineer in java,i have sucessfully installed my JavaEE1.5 software on my computer but have got a problem while compiling my Java programs ,while passing the commands in my command prompt i am encounteering a problem ,am geeting an error message in my command prompt" 'javac' is not recoginized as an internal or external command ,operable program or batch file".i had also tried my own software cd of JavaEE1.5 version and installed at others computers it is running sucessfully but can i know Why it is not geeting in to my Pc & giving compilation error while compiling my java programs. so kindly sujjest me my remedy of my problem.

  • Class conversion error

    Hi Friends,
    I'm new to Java card technology. I set the environment variable and the remaining properly. I'm using Windows XP platform And using Java 1.4 and Java card 2.1.2. When I run "build_samples.bat" after compiling the Java file successfully, when It tries to convert the class file into JCA or CAP it says an error "unsupported class file format of version 46.0". I don't what it means and how to rectify that?
    Thank you for helping me.

    Use JDK 1.3 as stated in the Java Card Kit or use something like the options -target 1.1 -source 1.3 with the compiler.

  • Stand alone APEX listener install fails with timezone region  not found

    Hi,
    I have searched the forum but found only a thread for the installation with Goldfish.
    I am very new to all this so I apologise if my problem is too simple, but please help as I am very frustrated with it.
    I have a 10.2.0.4 database on Windows XP for testing with.
    I installed APEX into it successfully, then down loaded the listener.
    I have to Java installations, one under my Oracle Home, the other under Middleware where I have JDeveloper installed.
    If I try $ORACLE_HOME/jdk/bin/java -jar apex.war it throws a Unsupported class version so I tried with the Middleware jdk and it appeared to install.
    I then went to http://localhost:8080/apex/listenerConfigure and entered the password for APEX_PUBLIC_USER and the info for a basic connection, it fails with the following message
    Request could not be processed due to error:
    Sat Apr 30 00:06:30 CAT 2011
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region not found
    Please if anyone can help me through asap this I would be most grateful

    Yay, I found the solution:
    I started by running:
    begin
    for v_rec in (select tzname,tz_offset(tzname) v_offset from v$timezone_names
    where tzabbrev='CAT') loop
    dbms_output.put_line('tzname '||v_rec.tzname||', offset '|| v_rec.v_offset);
    end loop;
    end;
    SQL> /
    tzname Africa/Khartoum, offset +03:00
    tzname Africa/Windhoek, offset +01:00
    tzname America/Anchorage, offset -08:00
    tzname US/Alaska, offset -08:00
    PL/SQL procedure successfully completed.
    I then added -Duser.timezone="+01:00" before the apex.war ie
    java –jar -Duser.timezone="+01:00" apex.war

  • Converting CAP file to JCA using normalizer

    Hi, I'm trying to generate 2.2.1(or 2.2.2) JCA file from 2.2.1(or 2.2.2) CAP file using JCDK 3.0 normalizer. I generated class files successfully but when using converter from javacard-kit 2.2.2 i get following error messages
    unsupported class file format of version 50.0.
    Is there any way to solve the error? I also like to know if there exists any other tool other than normalizer to convert cap file to jca file,

    javac -g -source 1.2 -target 1.2 -classpath $JC_HOME/lib/api.jar:$JC_HOME/lib/installer.jar src/xu/test/*.java -d binYou can have a look at the man file for javac in the section source/target and try the different options. I'm using sun-java6-jdk with these compiler parameters and have no problem when it comes to converting the files.
    Hope this can help you.
    Cheers

  • "general access denied error" while implementing out-of-process COM Server Implementation in Windows Phone 8.1

    I have a Service (.exe) where I was registering for my COM Component like below
    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    HRESULT hres = CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, 0);
    if (hres != S_OK)
    OutputDebugStringA("Security Descriptor not initialized");
    ITypeLib* pTypeLib;
    HRESULT hr_1 = LoadTypeLibEx(L"ServiceIdl.tlb", REGKIND_REGISTER, &pTypeLib);
    if (pTypeLib != NULL)
    pTypeLib->Release();
    RegisterServer(L"Service.exe", CLSID_classAImpl, L"ClassAImpl Sample", L"Component.ClassAImpl", L"Component.ClassAImpl.1", 0);
    g_hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    DWORD reg = 0;
    IClassFactory *pIFactory = new classAFactory;
    HRESULT hr0 = CoRegisterClassObject(CLSID_classAImpl, pIFactory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &reg);
    if (FAILED(hr0))
    OutputDebugStringA("classAImpl is not registered");
    CoUninitialize();
    exit(1);
    HRESULT hr1 = CoResumeClassObjects();
    if (hr1 == S_OK)
    OutputDebugStringA("classAImpl is Resumed Registering");
    WaitForSingleObject(g_hEvent, INFINITE);
    CloseHandle(g_hEvent);
    CoRevokeClassObject(reg);
    pIFactory->Release();
    CoUninitialize();
    From Client Code I am CreatingInstance  Like Below
    COSERVERINFO si;
    MULTI_QI qi;
    COAUTHINFO cai = { RPC_C_AUTHN_NONE, RPC_C_AUTHZ_NONE, 0, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, 0, EOAC_NONE };
    si.dwReserved1 = 0;
    si.pwszName = L"\\\\localhost";
    si.pAuthInfo = &cai;
    si.dwReserved2 = 0;
    qi.pIID = &IID_classA;
    qi.pItf = NULL;
    qi.hr = 1;
    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    HRESULT hr = CoCreateInstanceEx(CLSID_classAImpl, 0, CLSCTX_LOCAL_SERVER, &si, 1, &qi);
    hr returning error "general access denied error";

    I think we may run into the limitations mentioned in the remarks of CoCreateInstanceFromApp doc(show as below). If you can provide a repro project, I
    can give you more details about what happens.
    The CoCreateInstanceFromApp function reads class registrations only from Fusion contexts and manifests, and from the HKLM\SOFTWARE\Classes\CLSID registry hive.
    Only built-in classes that are supported in the app container are supplied. Attempts to activate unsupported classes, including all classes installed by 3rd-party code as well as many Windows classes, result in error code
    REGDB_E_CLASSNOTREG.
    The CoCreateInstanceFromApp function is available to Windows Store apps. Desktop applications can call this function, but they have the same restrictions as Windows Store apps.
    If you are trying to call some windows classes in your library, I will suggest you check how to create windows runtime out of process component by viewing
    this sample. This is what I usually do.
    To be honest, I did not try to implement the out of process COM component using the method you tried as we previsouly do on desktop. I will suggest you try to register a very simple library(like a signle class and single interface which returns an integer),
    and see if it will work.
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • How to run the simple java card program in eclipse?

    I am trying to run a simple HelloWorld program in eclipse 3.5 having java card development kit 2.2 installed in it.
    Firstly,I go to the JCWDE tab and press start..then when trying to deploy that package its giving me error like " com.hw.HelloWorld: unsupported class file format of version 50.0." can any one help me in this what is this error???n how to resolve n run this program..

    Hi,
    It is because the converter works on byte code and it only supports a subset of the Java language (see the JC specifications). It is kind of like compiling you code on Java 6 and trying to run it on Java 5. The JCDK outlines the required compiler version.
    Cheers,
    Shane

Maybe you are looking for

  • Please Help! I don't know how to get rid of this extension!!

    I purchased this mac book pro in the middle of 2014. So it's not even a year old. About 4 months after purchasing I noticed that I started to get pop ups that were opening new tabs. Particularly 'Mackeeper'. I don't know if this is an extension or wh

  • Safari & Mail issues I am having after moving over to Safari from Mozilla

    I am transitioning from Mozilla to Safari for mac and it is a very painful process. Nothing seems to work intuitively. Some issues I am having: In Mail 1. When deleting the mail in my mail box, it always deletes from the bottom up and not the top dow

  • Safari browser crashing

    Please help, Safari crashes on my 7.0.4 iPad. It is usually on Facebook but also when using some Apps as well. I have been checking for an update each day as hoping that would stop this happening..

  • Two Filter on Two dimensions without constraining the fact table

    Hi All, does anybody know how to avoid the fact constraint when creating a report with two filters on different dimensions? I have a big fact table with more than 10 Million rows. In the starmodel the is the dimension customer and products. I create

  • Unable to use allocate B1 Starter Pack license

    Hello Experts, I need to test the Starter Package (or B1 Starter Pack license) but I have trouble to switch to the B1 Starter Pack user license. In my testing environment, I am currently running 8.8 with the Professional user license. So far, I did;