How to tell what java version classes where compiled?

Is it possible to get the version of the Java SDK the classes were compiled with from within a Java application? I think about something like:
System.out.println("Application classes compiled/compatible with "+getClassCompilationVersion());

For the minimum check, the point is that i get the following exception when i try to run a application that was compiled with/for 1.4 is tried to be started with a 1.3 JRE:
Exception in thread "main" java.lang.UnsupportedClassVersionError: de/icomps/pro
totypes/Test (Unsupported major.minor version 48.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
6)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)I hoped to somehow catch this and print a clean error message. But it seems, that the new classes can't be used ... even though the main() method doesn't use any 1.4 specific API. The JVM rejects the classes just because of the newer class file format versions.

Similar Messages

  • How can i tell what itunes version i'm running?

    how can i tell what itunes version i'm running?

    Mac OS 10.0 – Cheetah
    Mac OS 10.1 – Puma
    Mac OS 10.2 – Jaguar
    Mac OS 10.3 – Panther
    Mac OS 10.4 – Tiger
    Mac OS 10.5 – Leopard
    Mac OS 10.6 - Snow Leopard
    Mac OS 10.7 – Lion
    Mac OS 10.8 - Mountain Lion
    Mac OS 10.9 - Mavericks (This release marks the beginning of a change in the naming scheme of OS X, departing from the use of big cats and moving to names based on places in California.Following the new naming scheme, the current version of the operating system is named Mavericks, after the surfing location in California.)

  • How to check the JDK version of a compiled java file

    can anybody tell me how to check the JDK version of a compiled java file ?
    Edited by: gbhatia8 on Sep 9, 2010 7:04 AM

    The major/minor version of the class file is the way to go.
    Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
    Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK.

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

  • How to tell what packages have recently run

    Occasionally, after start up, I'll see something that looks like a package that quickly runs.  I have no idea where to look for information to figure out what ran.  I've ran searches trying to find out how to tell what packages have recently run but have not found anything useful.  If anyone knows or has any ideas on what I can do to figure that out, I'd love the help.

    You are welcome. Based on my experiences, the only time I look at Console is when something is not working. You could get overly engrossed trying to figure out what everything means.

  • Icloud has has exclamation but I don't know how to tell what the error is?  I recently selected bookmarks for syncing.

    icloud has has exclamation but I don't know how to tell what the error is?  I recently selected bookmarks for syncing.

    TM will show it has done a backup.. Look at the info.. when was the backup completed??
    If you want more details install the widget.
    A1 here.
    http://pondini.org/TM/Troubleshooting.html
    The time capsule though blinks amber and the Airport Utility shows blinking amber light and has a red circle with the number 1 in it.
    There is an error.. probably trivial.. firmware update, default password..
    Open the airport utility and find out what the error is.
    Simply click the TC and see status in the summary page.. it will list all the errors and what you should do.. fix or ignore them. ie this TC has an error.. default password.. I chose to ignore.. when I "fix" the problem the LED goes green.
    Here is additional TC.. it is blinking amber with faults.
    Click the fault. eg default password.
    You can ignore or edit .. if you click edit it will take you to the full setup where you can change the settings.
    I ignored my errors and now it is green..

  • How do I delete java version 1.6.0_37? This update prevents me from running PowerTeacher Gradebook; I want to go back to 1.6.0_35. Thanks

    How do I delete java version 1.6.0_37? This update prevents me from running PowerTeacher Gradebook; I want to go back to 1.6.0_35. Thanks

    arnab wrote:
    I wanted to know if you are asking for the html version or you want the html itself. ..I want you to post the complete, (but short & validated) HTML used to test this applet, directly into the thread - with code tags. I'm really not sure what you mean by the HTML 'version'. The only thing I can associate with that is HTML Spec. 3.2, 4.01, 5.0 etc., but I cannot see how it relates to anything I mentioned (and in any case, the 'version' should be obvious from the copy/pasted HTML).
    ..The website is our client website and this problem is coming during login. I won't be able to share the credentials with you. I don't want any 'credentials', but I will expect that if you are serious about solving this problem, you will set up a version of the applet at a public URL so others can see it fail if they think it will help solve the problem. Of course, what you do is up to you, because ultimately it is your problem, not ours. (I just thought I'd stress that last part to indicate to you that it is your onus to encourage people to read, experiment & answer.)
    The only change I need to do to make it work is enable update 23 and disable update 24 in Java Control Panel.Have you tried searching the bug database for hits? There were some security updates in 1.6.0_24 that affected a number of things, including copy and access to the Robot. Perhaps there was a bug introduced at the same time.
    ..Unless I have misunderstood & what you are trying to do is somehow related to (yet) another security bug fix. ;)

  • How to tell what template is applied to a Framemaker file?

    I'm new to Framemaker...so please excuse if this is a silly question.
    We are trying to figure out how to tell what template has been applied to a Framemaker file. We are using the structured view in Framemaker 7.2.
    Perhaps I am thinking too much like a Microsoft Word user -- in which case I can look at what template has been applied to a document.
    Does Framemaker work the same way -- or are templates associated with Framemaker files in some other way?
    Thank you --
    J-Ha

    J-Ha,
    FrameMaker works differently. Strictly speaking, there is no way to tell which template was used last. A FrameMaker template is just a FrameMaker document which you call "template". Using File > Import > Formats you can import all or selected formats from one document to another. The main benefit: Each document is completely self-contained and does not require any other document.
    Many solutions I know of include a user variable named something like "template-version" into their template document or put the version information on one of the reference pages. When importing user variables or reference pages, this can tell you version imported last.
    - Michael

  • How to tell what codec has been used??

    Hi
    Just wondering how to tell what codec a particular video clip has been encoded in? I cannot see it anywhere in bridge. after fx dos it for some but not all clips.
    cheers
    angus

    if you're using Loader to load the swfs, you could examine e.contentLoaderInfo.url to see which swf it is

  • How to tell what has been downloaded/installed on iphone 4s

    how to tell what has find and read hidden log filesa/programs on iphone 4s

    Again, it's not universal. It's not a feature of any cell phone I've ever seen in the U.S. And, it's not a feature of the iPhone.
    Submit feedback to Apple requesting such a feature here:
    http://www.apple.com/feedback

  • Finding java version used from compiled code

    Is there a way to find the java version used to compile the java file from the compiled files,i.e., class files?

    that information is encapsulated within the .class file, I don't think so.
    The class file has a minor_version/major_version field.
    However using jikes and sun jdk 1.3.1 both produce a version number of 45.3. According to a footnote in the JVM spec that corresponds to a class file format for java of 1.0.2. And both obviously are newer than that version of java.
    Based on that I don't think one can expect those numbers to changed based on the java version but rather on any changes in the class file itself.

  • TS1317 I have just purchased my Apple on plugging in my wireless internet usb it says I need a Java runtime, how do I know what Java runtime and where do I download it from?

    Can anyone tell me what 'Java runtime' is required to get my Blink usb internet connection working and where I can download it from?

    Holly cow, I don't see where it supports anything but Windows®!?
    http://www.blinkit.net.au/Support
    Also, pretty dangerous of them to require Java to use this.
    Anyway, open Applications>Utilities>Java Preferences, that'll tell you the Versions you have... might need to check "Enable applet Pug-in and Web Start Applications", not sure.

  • How to tell what version of Acrobat or Reader was last used to save a PDF

    How can I tell what version of Acrobat or Reader was last used to save a PDF file? My users are using fillable forms from grants.gov. We want them to use Adobe Reader 8.1.3 to fill these forms, but some accidentally use the Pro version of Acrobat. They need this to make PDFs from Word & other apps, but Pro will corrupt the fillable forms.
    When I open a saved form in Reader 8.1.3 and click File > Properties it says Acrobat 7.x even though I know it was saved with 8.1.3.
    Is there a way to know which version number and type (Reader or Pro) last saved a PDF?

    But it won't tell you what was used last. It just gives the original information.
    It also won't differentiate between Pro and Standard and of course won't mention Reader at all.

  • How to tell what version of a document the workflow ran against?

    I am using the OOB Approval workflow and in the workflow information I see a Document field, but that links latest version of the document. How can I tell what version of the document the workflow actually ran against?

    Hi,
    Set a variable in the workflow to be equal to the version of the document.
    Now you can use this variable to update a column in the document library with the version and date the workflow was ran. Next time the workflow runs, update this column with next run details.
    OR write this variable to workflow history. Hope it helps.
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • How to tell what version of Mac OSX?

    Hello;
    I am a person who  works for a university here in the US. Alot of the times, I have macs that dont boot, but I can see the data from the hard drive, via an external dock. Is there a way to tell what version of the OS is from a strictly file level? Without being booted into the OS?
    Thanks,
    Brian

    If the computer's booted into an OS which doesn't support that(not all Mac OS X versions do), open the file /System/Library/CoreServices/SystemVersion.plist in any text editor.
    (70579)

Maybe you are looking for