Jar file runs on windows but fails to run on macbook

hi, i developed this app using netbeans on windows and the .jar is runing fine, but when i transfered the jar file to a macbook and double clicked the jar file, it dint run, then i tried to run it from the terminal i got the following exception. please what could be the problem
mustapha-mohammed-kutas-macbook:~ mustaphamohammedkuta$ cd desktop
mustapha-mohammed-kutas-macbook:desktop mustaphamohammedkuta$ cd mustee
mustapha-mohammed-kutas-macbook:mustee mustaphamohammedkuta$ java -jar PayrollProject.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
     at java.lang.ClassLoader.defineClass2(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:774)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
     at payrollproject.Main.main(Main.java:34)
mustapha-mohammed-kutas-macbook:mustee mustaphamohammedkuta$

This means the version of Java you're using on the Mac is older than the one you made your jar file with. I believe the default Java on Mac is Java 5. Perhaps you built your classes and jar with Java 6?

Similar Messages

  • Determining the name of the jar file running from JAVA

    Hi everyone,
    This is probably a silly question, but how do you determine the name of the jar file running from within the jar file.
    E.g. If I'm running the jar file "Test.jar", then how can I get the String value "Test.jar" from within my program?
    Any help would be appreciated! Thanks:)

    I think that you can use the solution above to get the jar file resources associated with a particular jar file, and then use the JarFile class to get a manifest of whats in there, and then find your class?
    This is only off of the top of my head, and I haven't tested it. Let me know if it works

  • I purchased Creative Suite 6 Design Standard for windows, but I now have a MacBook, how can I download it onto my Mac - please tell me I don't need to spend another £1000!! :(

    I purchased Creative Suite 6 Design Standard for windows, but I now have a MacBook, how can I download it onto my Mac - please tell me I don't need to spend another £1000!!

    Change product platform or language
    You can swap languages/platforms for a latest version product (CS6 only) if you follow the instructions at the following link:
    http://helpx.adobe.com/x-productkb/policy-pricing/order-product-platform-language-swap.htm l
    Alternative: If you wish to continue using the software on the Windows machine as well then your only recourse without buying again would be to install a Windows emulator on the Mac so that it has the rght environment to install in

  • Opening a file succeeds in Linux but fails in Windows

    Hi,
    I have written an addon to OO Writer. It works properly with GNU-Linux (Ubuntu 9.04, JAVA 6)
    I tried it under Windows 7 RC (I have no other Windows OS available)
    I have a problem opening a file.
    Here is the code I use
    class Dictionary {
       ArrayList brutEntry = new ArrayList();
       ArrayList entryList = new ArrayList();
       DicEntry temp = null;
       public boolean enamdictEnabled;
       public boolean edictEnabled;
        * @param dicFileName A String representing the name of the edict  file which contains the dictionary entries
        * Each entry correspond to a line of the file
        * The dictionary must be EUC-JP coded.
        * @exception exceptions No exceptions thrown
       Dictionary(String dicFileName, String signature) {
          File f=new File(dicFileName);
             WarningHandler.displayMessage("I did; File f=new File(dicFileName); with "+dicFileName+" as a file name"+
                     "\nthe reselt is: "+f.toString()+" with f.toString()");
          BufferedReader i = null;
          try {
          i = new BufferedReader(new InputStreamReader(new FileInputStream(f), "EUC-JP"));//dicFileName
             String str1 = null;
             while ((str1 = i.readLine()) != null) {
                // System.out.println(signature+"making a new entry"+Integer.toHexString(index));
                temp = new DicEntry(str1);
                temp.entrySignature = signature;
                entryList.add(temp);
          } catch (IOException ex) {
             System.out.println("Error message: "+ex.getMessage());
             Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex);
             WarningHandler.displayMessage("There was a problem opening or reading the " + dicFileName +
                     " dictionary file. Please check that your file and filepath are correct and" +
                     "that your dictionary file is EUC-JP encoded");
          } finally {
             try {
                i.close();
             } catch (IOException ex) {
                Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex);
      At first I used
         i = new BufferedReader(new InputStreamReader(new FileInputStream(dicFileName), "EUC-JP"));//dicFileNamewithout the intermediate File creation but the result is the same, under Linux it works and under Windows it fails opening the file.
    From my WarningHandler.displaymessage method I can see taht the file name is correctly (at least I guess) as it is:
    /home/jaaf/jilt/theFileName with Linux
    c:\Users\jaaf\jilt\thefileName with Windows
    For information the file theFileName is EUC-JP encoded and contains Japanese Characters
    Thank you for help
    Edited by: meaulnes on Jul 8, 2009 5:19 AM
    Complementary information after investigation
    I split the line
    i = new BufferedReader(new InputStreamReader(new FileInputStream(f), "EUC-JP"));//dicFileName
    in 3.
    It seems that FileInputStream and InputStreamReader pass without problem.
    But the line
    i=new BufferedReader(isr); where isr is the InputStreamReader makes the program crash (Even the catch is not treated).
    The message I get is:
    Run Time Error
    prog C:\ProgramFiles\OPenOffice.org3\program\soffice.bin
    The application has requested the RunTime to terminate it in an unusual way.
    please contact application support....
    Edited by: meaulnes on Jul 8, 2009 5:31 AM

    Hi,
    Thank You for help;
    I used stack trace
    It seems that the error comes from the encoding.
    Here is the trace:
    java.io.UnsupportedEncodingException: EUC-JP*
    +     at sun.nio.cs.StreamDecoder.forInputStreamReader(Unknown Source)+
    +     at java.io.InputStreamReader.<init>(Unknown Source)+javascript:void(0);
    +     at com.zoraldia.openoffice.Dictionary.<init>(Dictionary.java:71)+
    +     at com.zoraldia.openoffice.Jilt.createDictionaryDialog(Jilt.java:2477)+
    +     at com.zoraldia.openoffice.Jilt.dispatch(Jilt.java:1948)+
    Jul 8, 2009 4:23:32 PM com.zoraldia.openoffice.Dictionary <init>*
    SEVERE: null*
    java.io.UnsupportedEncodingException: EUC-JP*
    +     at sun.nio.cs.StreamDecoder.forInputStreamReader(Unknown Source)+
    +     at java.io.InputStreamReader.<init>(Unknown Source)+
    +     at com.zoraldia.openoffice.Dictionary.<init>(Dictionary.java:71)+
    +     at com.zoraldia.openoffice.Jilt.createDictionaryDialog(Jilt.java:2477)+
    +     at com.zoraldia.openoffice.Jilt.dispatch(Jilt.java:1948)+
    I don't understand why on Linux it works but not on Windows

  • Jar file runs from the command line, but not when I double click it

    Hello, I'm running windows xp. I've created an executable jar file and it runs fine from the command line when I type;
    java -jar wizard.jar
    but, when I double click it . . . nothing.
    Any ideas?

    nothing ? that's weird, windows XP should prompt you to select the program you want to use in order to open Jar files (and give you this silly piece of advice to search the web for the appropriate program)
    you might want to check what program (if any) got associated with .jar extensions :
    in Windows Explorer : Tools => Folder Options => File Types
    hth

  • JAR file problem with windows operating system rare

    hi,
    I have an application created with Eclipse 3.2, which also have a plugin that helps me to create jar files, migrate days ago all my application and my data base to a notebook that has a very rare operating system is Windows Vista, but is a version very rare and never seen, called oneAngel Illusion, and I think that that is not capable of running the JAR correctly, that when you double click or enter to JAR nothing happens, and I prove it on a machine that has XP and functioning properly.
    I hope I can help with this!

    pg_shadow wrote:
    hi,
    I have an application created with Eclipse 3.2, which also have a plugin that helps me to create jar files, migrate days ago all my application and my data base to a notebook that has a very rare operating system is Windows Vista, but is a version very rare and never seen, called oneAngel Illusion, and I think that that is not capable of running the JAR correctly, that when you double click or enter to JAR nothing happens, and I prove it on a machine that has XP and functioning properly.
    I hope I can help with this!You should know, if you don't already, that your 'super rare' version of Windows Vista, sounds like one of numerous, illegal, cracked and knocked-off versions of Vista that have been floating about. Things like Windows Vista Silver and Windows Vista Sky are not only completely illegal reproductions of pirated copies of Vista but they often have terrible bugs and security deficiencies that can sacrifice the integrity of your data. Honestly, if you're already shooting yourself in the foot with this bootlegged operating system, just get Linux, it's just like stealing but without the unsavory prison shower encounters.

  • JAR files under WEB-INF but not in lib directory

    I am working with JDeveloper 10g and I have several jar files under WEB-INF/lib and other under WEB-INF/libEst.
    I have add this libraries to Project properties > Paths and it works fine when I run my aplication in local environment, but it fails when I deploy and run in the server.
    I have configured our deploy file to include these WEB-INF/libEst jar files, but when I deploy to our server, it seems to be that this classes included in these jar files are not reachable and they cannot be loaded and throw a ClassNotFoundException.
    Is it possible to have jar files under any WEB-INF subdirectory distinct of /lib?
    Why is it working in local but not in server?
    If someone can help me to configure this in order to deploy in server, I will be very grateful.
    Thanks a lot,
    Antonio.

    Hi Antonio,
    I think this document is what you are looking for: http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-servlet-warmanifest.html
    .. your manifest entries would look like
    Class-Path: WEB-INF/libExt/<jarName1>.jar, WEB-INF/libExt/<jarName2>.jar, ...
    Let me know if this works for you.
    thanks,
    Harsha

  • How to make jar files run using java.exe and not javaw.exe

    Hi ,
    I am developing a project in which there is an GUI which inturn will call a console . I have made it into an jar file now.
    Here comes the problem. When i run the jar files , i don't get a console. While going through this forum, i came to know that jar runs using javaw.exe and this stops it from bring the console up.
    Please suggest me a way of running the jar file through java.exe or any other method by which i can get an new console poping up.
    PS : i cannot start the application itself in a system console , because the Console mode is an added feature and it is not to be displayed every time but only when the user intends to.

    Thanks for the reply pbrockway2. But i think, i was not able to convey my problem properly.
    I am supposed to start my application in a GUI mode ( No console are should be present at this point of time). Within the GUI , i have a option for working in the console ( i.e if console is choosen, then i start giving my output and take inputs from the console. I am trying to do this by just calling the "System.out "and "System.in" methods. )
    Here is the problem. As i have started it through " jar " it would not have a associated console with it.
    PS: i cannot have launching .bat file because that would result in my application having a console displayed at the very start of the application. I want the console to be displayed only when the user wants to start in console mode.
    Please suggest me some ways of doing this. Can i create a console from my java program and then exit it.

  • Application's jar files deleted after Windows XP power failure

    Hi,
    I'm using JRE 1.4.2 to run our WebService Management environment (4 java servers + proxy, each one in separate JVM). After a power failure of my PC, all jar files in use of java servers disappear from the systems without any trace in log files.
    I never reproduce it, also unplugging power many times.
    Has samebody experienced that or has ideas to solve it.
    Thanks
    Alfredo Scotto (SOA Software) [email protected]

    Hello alfredo,
    The same Problem I am also facing. If the Sudden power failure happens , some of the files gets deleted. without giving any trace.
    But thing is hardly I was able to reproduce the Bug.  I am also Finding the cause of the same.  If u find the plz do suggest me.
    Thanks & Regards,
    --Prasanna Bhat+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is it possible to have a file hidden in Windows, but visible in OS X?

    Essentially, I am trying to have a thumb drive with two versions of a piece of software, one Windows executable, and one Mac executable. I want the Mac file hidden in Windows, and vice versa. I found that I could use SetFile and make a file invisible, which Windows will ignore. However, it seems Mac does not ignore the hidden attribute for Windows. This is a problem for my use case. Is there any way to achieve my goal? I am open to different file systems (NTFS, fat32, UDF, ISO9660/Joliet, etc)

    You could try to partition the thumb drive into two partitions, one for Mac, OS X Extended (Journaled), and one for Windows, FAT 32.  Windows computers can't read the Mac partition without 3rd party software. Macs can read and write to both partitions.

  • Dvd for adobe creative suite 5.5 web premium has set-up.exe for windows, but how to install on macbook?

    Hi,
    I have the dvd for adobe creative suite 5.5 web premium, I see a set-up.exe for windows, but how do I install this software on my macbook please?
    Thank you
    E

    You can't one way or the other. Serial numbers are platform specific and platform swaps only apply to current  versions, meaning you have to upgrade to CS6 and make the switch.
    Mylenium

  • Very new to Java, trying to make a jar file run on WM6

    Ok so i downloaded this java progam that is supposed to work on "java-enabled" phones. So i have windows mobile 6, which is able to run java but i think its limited to the browser. when i try to run it on a virtual java machine i recieve the following error.
    java.lang.Exception: No Main-Class attribute in \My Documents\TrafficPilot.jar
    at java.lang.VMMainThread$1.run(VMMainThread.java)
    at java.lang.VMThread.run(VMThread.java:120)
    JVM exit
    what is needed to make this work? or is it even possible?

    Hi, welcome to the Sun Java forums.
    Pester the person who gave you the JAR, s/he did something wrong.
    Pass this information on to them:
    Add a MANIFEST.MF file in the JAR's META-INF directory (all names case-sensitive) and put this line in it, with two Enters after it:
    Main-Class: mypackage.MainClassName
    Though if the JAR contains an applet (which would explain why it only works in a browser), it might not have a main class.

  • Trying to transfer file via Ethernet Cable - but failing. Why?

    Hi,
    Many thanks for your attention.
    I am trying to transfer a small file from a MacBook Pro to a Mac.
    What step am I missing?
    1. Both Macs on. On both Macs, Airport is turned off.
    2. A Crossover Ethernet Cable plugged into both Macs.
    3. Under System Preferences/ File Sharing is turned On in both computers.
    4. Don't know if this is necessary - but under System Preferences/ Security - Allow all Incoming Connections is checked.
    5. On the computer that I want to receive the file:
    Under Finder/ Go/ I select Connect To Server
    6. Then I click the Browse option.
    7. The 1st Computer's icon appears in a window.
    8. I click on the icon.
    9. For a few moments, it says - "Connecting - "
    10. But then after a few moments - Connection always Fails.
    Followed these steps via other Posts, but they must have neglected to mention a step I am missing.

    moonlightcaravan wrote:
    Second, seeing "connecting" and connection failed is normal. You must click on "Connect As" in the Finder window and then enter the username and password for the admin account on the other computer. That should fix things.
    Thanks for responding.
    When does clicking on "Connect As" happen in the process above?
    After step six? Seven?
    After the connection has failed?
    Is this the FInder window that shows the icon of the computer you want to copy the file from?
    You should see "Connect As" in the Finder near the top right of the window as shown below:
    !http://blog.brothersoft.com/wp-content/uploads/2008/11/howto_copy_files_to_or_from_your_iphone02.jpg!

  • How to search files on a windows configured external hard disk on macbook air

    I am trying to search files on my passport Ultra Western Digital, which is configured for windows and has read only permissions for my macbook air, i am unable to instant search results through finder or spotlight. Is there a way to search them?

    Well, to clarify:
    I want to find all user text files and mail messages on a Time Machine backup disk that contain the word "escalator".
    By user files I mean those in
    /Volumes/Time Machine Backups/Backups.backupdb/<username>iMac/*/Macintosh HD/Users
    and subdirectories thereof.
    I was trying to use the find command, but it was taking a very long time, so I aborted it. I then realized that most of the files have many hard links, and therefore will be searched many times. That, of course, is a great waste.
    Is there some way to search each file only once?
    Thanks.

  • How to create service in Windows XP for jar file?

    Dear friends,
    I'm having an jar file in my Windows XP OS. I would like to create new service Windows XP to run this jar file. When i start the service then the jar file to be executed.
    I did search in google but i didn't get any proper solution for this.
    Could anyone please tell me the best and easiest way to create service for my jar in Windows XP os.
    Thanks in advance,
    Sathish

    Hi Chennail123,
    Just have a read : [*Converting Your Java App into a Windows Service*|http://www.devx.com/Java/Article/34438].

Maybe you are looking for

  • HT5848 No streaming radio provided in non English speaking countries.

         As an International teacher I have enjoyed iTunes streaming music on my iMac, and before that on my Windows computer, for 9 years. I bought an iPad earlier this year and thought it would have the same programs available as Mountain Lion but it d

  • Workitem getting into reserved status

    Hello Experts, We are experiencing this strange issue in SAP workflow where the Work item is getting reserved with particular user. User is of opinion she has not forwarded the work-item to anyone.below is the snapshot of the Error she is experiencin

  • PI table for Pipelines

    Hi everybody, I wonder If someone know in which table I can find the details for start/end time for each pipeline for each PI message. Exactly I want to know how much time took the message mapping to process the message. Any help will really apprecia

  • Add custom fields to standard tab in BP

    Hi , I want to add a new field in address tab in communication area. I tried doing through EEWB but the transaction creates a new tab and adds the new fields.Can anybody suggest how to shift the custom fields from the new tab to standard tab. Many pe

  • Come aprire un file in txt

    come aprire un file in "txt"