Compile target 1.6 = JAR not executable anymore (double click)

I made my JAR executable by adding "Main-Class:" and "Class-Path:" entries into the manifest file. This works great with Java 1.5 compiled code. But simple switching the compile target from "1.5" to "1.6", the generated JAR is not executable anymore and shows an error dialog instead:
Java Virtual Machine Launcher
Could not find the main class. Programm will exit.
I create the JAR with an ANT script. Just toggling between target "1.5" and "1.6" forth and back results in an executable JAR (for target "1.5") or this error (for target "1.6").
Strange: it works when I call the JAR from command line (java -jar myJar.jar), so the error above only occurs when double clicking. (Running on Windows 2000, JDK 1.6.0_03)
I haven't found any notes about changes in the manifest file for target 1.6 compiled classes.

PraveenKJain wrote:
I have created a executable jar file of an swing desktop application, It is working fine if i use the command line (java -jar option) but when i try to execute it by double clicking its shows the error message (could not find the main class. program will exit).If this is a Windows icon, then I suspect the "Start in:" directory is wrong. Mind you, judging by the classpath, it doesn't look like whatever tool created your executable jar did a very good job.
Winston

Similar Messages

  • How to make .jar files executable by double clicking

    hi,
    I've been trying to make my .jar file created via ANT Tool executable by double clicking it but I'm not being successfull. I looked at the ANT Tool for making manifest.mf and I included most of the attributes listed there and later found that Main-Class attribute is required but its not mentioned in the documentation.
    So, I'll be very greatful to receive any suggestions
    regards,
    Jay

    ya I've been doing things the same way mentioned there but it isn't working. here is the code for it:
    //All the .class files are in the build directory and the class files are under the package org.home.proj.
    <!-- For making .jar files -->
    <target name="jar" depends="compile" description="Makes CyberStation.jar from the CyberStation code.">
        <mkdir dir="${bin}" />
        <jar jarfile="${bin}/CyberStation.jar" basedir="${build}">
          <exclude name="**/run.bat" />
            <manifest>
           <attribute name="Buily-By" value="${user.name}" />
           <attribute name="Main-Class" value="org.home.proj.CyberSoft" />
             <section name="org/home/proj/CyberSoft.class">
               <attribute name="Sealed" value="false" />
             </section>
         </manifest>
        </jar>
      </target>It show the error: Could not find the main class. The program will exit.
    regards,
    Jay

  • Jar file not executing on double-click

    Hello,
    I have a .jar file that I would really like to execute using a double-click in win xp.
    I can execute the jar file witha java -jar command on the command prompt and the program runs but when double-clicking i get the error: cannot find the main class: program will exit
    I had win rar installed on my computer which changed itself to the default app to open jar files.
    So this is what I've tried
    I tried modifying the registry command to run java -jar, javaw -jar but they don't work.
    I have created several manifest.mf files with this in them
    Manifest-Version: 1.0
    Created-By: 1.4.2_07 (Sun Microsystems Inc.)
    Main-Class: MyClass
    I know that a carraige return needs to be at the end though I don't know really how to check for it (I assume its there because I have a few extra lines after the last text peice). I've read through some other threads but nothing seems to work. It's getting really annoying always having to go through the runline. Thanks for the help.

    I don't understand why Netbeans has such a hard time creating working jar's for applications. This is the second time I've written an application that just will not work when trying to execute using the jar. The last time this happened I used Eclipse and imported everything (including the layout) and Eclipse got it working the first time.
    This time, I thought I'd go back to Netbeans since they released a newer version 4.0 (I haven't gone to 4.1 yet). Apparently nothing has changed as my application, once again will not run from the jar. What's the deal with Netbeans?
    I think I'll, once again bring my project into Eclipse and have that make the jar.
    Kurt

  • JAR suddenly not working on double click...

    I have a program that I have been working on for the past few months. I want to run it from the desktop in the form of a .jar file. I use netbeans to create the jar file. In previous versions, this has worked very well. With the most recent build, I have problems running it when clicking on it.
    When the .jar is within the project's folder it is possible to run by double clicking. When I take that same file and move it anywhere else, for example, the desktop, it will not run on double click. It forms a javaw.exe process and hangs. I can run the newly moved jar from the command line with "java -jar 'path'", but not with the double click I want. I have tried this on several computers using the same version of Java..
    This really puzzles me cause it has worked as intended for a few months now, but not anymore.. If anyone has any suggestions of why this might be happening, it would be very much appreciated as I really need this thing to run like I hoped it would
    Thanks!

    no, there is a bug in your code that is causing this strange behavior. What people here are suggesting is that this bug is probably causing an exception, but you are not handling this exception correctly, probably catching it but never doing even a printStackTrace(). This causes the application to fail without you knowing why.
    My suggestion is to run the code from an IDE so you can step through it in debug mode, and see where it is going wrong.

  • 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

  • HT1222 My mouse pointer in finder is not working by double clicking on the application.I have to double click and select open for opening the application.Can you suggest me some settings to fix this problem?

    My mouse pointer in finder is not working by double clicking on the application.I have to double click and select open for opening the application.Can you suggest me some settings to fix this problem?

    Hi,
    Try this ... reboot your Mac and see if double clicking works again.
    Also, you can just select the Application you like to open and hold down the Command+O to open.
    Also, did you check your setting for the mouse in system preferences.
    Dimaxum

  • Photos in my iPhoto library will not enlarge when double clicked on.  they fill the screen and then screen goes black.  hasn't happened before.  thanks--

    photos in my iPhoto library will not enlarge when double clicked on.  they fill the screen for a second (or less) and then screen goes black.  hasn't happened before.  thanks--

    There are several possible causes for the Black Screen issue
    1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
    2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/ Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help: As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Events will not open with double click/double click not working.

    Have just upgraded to iPhoto'11 and finding it a pain to use after previous iPhoto.  Events will not open with double click (even though highlighted in yellow) and photos will not open with double click or videos play.  How can we fix this please?

    That sounds very like an issue with your mouse/trackpad and not iPhoto. Go to your SystemPreferences and chck the speed you've set for double clicking
    Regards
    TD

  • "Check Names: Microsoft Outlook does not recognize '1. double click the attachment'" submit error

    I have seen this question/issue on multiple forums and nobody seems to have an answer/fix yet.  I included an e-mail submit button for my form, and when I practice submitting, everything sends fine.  However, if I distribute the form (to allow for tracking, etc.) I get an error pop-up window that reads "Check names"  "Microsoft Outlook does not recognize '1. double click the attachment'".  What I mostly don't understand is "1. double click the attachment" is part of the directions/content in the e-mail after they actually, successfully submit the form.  Why is the content auto-populating as part of the mailing address??  After you "Show More Names" and search for the correct recipient(s), you have the same error pop-up again with the 2nd step that's show in the content of the e-mail: "2. Acrobat will prompt you to select a responses file", until you select the recipients again by clicking "show more names".  Then the e-mail populates, with "Completed Form&body=Instructions to add this form to a responses file: [email protected]?subject=Submitting" as a recipient, as well as the 2 recipients you had to search for.
    Does anybody know why this happens and how to fix it!?

    We are having the same issue of trying to send a Shared Review from Adobe Pro XI and getting a error. We are currently using Outlook 2010. Hope someone from Adobe support can answer this issue and other Shared Review issues that are related in nature.

  • Class not found, Jar not executing

    Hello,
    I created a JAR file and cannot execute it by running java -jar myjarfile.jar. I get no error message and it does not execute.
    If I extract the JAR, and run my main class with java packagename.myclass it works fine
    If I run javaw myjarfile.jar it tells me it cannot find the main class
    My manifest file looks like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
    Main-Class: mypackage.Main
    This program works fine when unjarred and also from my IDE.

    xarfox wrote:
    Ok, in that case - is this behavior acceptable:
    The first thing I do is:
    configFile = reader.read(System.getProperty("user.dir") + "\\CustomConfig.xml");This stores the xml file in a variable of type document (which represents an xml document)
    From that point forward I have all the info I need. Can I do this inside a JAR?
    Additionally, do you have any feedback on how I can fix what seems to be a classpath issue. What command should I be using to run my JAR file to ensure that it is able to find "mypackagename.Main"
    Thank you!If I understand correctly, the file CustomConfig.xml is inside the jar. You do not need user.dir because getClass().getResourceAsStream() will look inside the jar, assuming the object you use was loaded from the jar. If I remember correctly, if your class is in a named package, you need to start the file path string with a / character - ...getResource("/CustomConfig.xml").
    Second question: If you correctly specify the main class, then you just need java -jar yourjarfile.jar

  • Please help suggestions for solving built-only compiler error: 'The VI is not executable. The full development version of LabView is required tofix this error.'

    We have develoepd a software tool and build it on regular basis. It currently runs error free when compiled in the editor, but when we built it and run the executable stand alone we get the error.
    'The VI is not executable. The full development version of LabView is required tofix this error.' plus a broeken error.
    This menas an compiler error that is not present in the editor but in the stand alone version. We tried to identify errors as suggested in several posts in this forum, but so far unsuccesfull.
    As the editor and its compiler do not see the error  and are running fine and the stand alone version just syas 'find the error in the editor' in this case LabView is of no help.
    Can anyone suggest a sensible or 'good practice ' way of searching for the source of this error?
    Our project  comprises hundreds of Vis over several libraries.
    Thanks,
    Chris

    Thanks Craig for all your suggestions.
    We seem to have located the problem in a new vi just added to the package causing conflicts by using the same vi names as other vis already present in the package. Excluding this vi removed the error.
    It seems related to a conflict by having two vis with the same name, which was mentioned by LabView and interactively resolved when running the main vi from the editor. When successfully building the main vi the builder did not mention this conflict and reported a successful build, but when trying to run the executable it gave the cryptic error. The error caused us problems because there was no hint for the cause, just the suggestion to solve this in the editor, while at the same time in the editor the VI was running fine.
    We will post about this in detail after we have positively proven that this actually was the case.
    The .net version issue was already checked.
    Performance was the same on all machines we tested on including the dev machine.
    Debugging was tried nut did not help as the vi could not run (broken arrow). We assumed that debugging only helps in running faulty functioning vi''s. We did not check for broken arrows in sub-vis (after connecting), that could have helped, although our application has hundreds of our own vis.
    In relation to your remark: 
    'Are you using many classes? Have you verified that the proper access scopes are set for functions calling those vis?'
    Could you elaborate on setting access scopes. We were not aware of this option in LabView, although we realize this is a basic element of the underlying c code.
    Ragrds,
    Chris

  • Photoshop CS2 will not open to double click in Snow Lepard

    Since loading Snow Leopard I have been unable to open Photoshop files with a double click. Double clicking .psd file opens PS with the message "Could not complete your request because Photoshop does not recognize this type of file." Right click "open with" gets the same result. I CAN open files through the file menu in PS. But, files opened via the file menu and saved as... will not open with a double click.
    The "Open with" in the file info window reads "Adobe Photoshop CS2". Even forcing it to open in Preview and then back to PS CS2, sort of like hitting it with a hammer, does not improve the situation.
    CS2 on and year old dual quad.
    Before you knee jerk a "CS2, what did you expect..." CS2 seems to work fine once open. And I have access to another brand new iMac 24" with CS2 and Snow Leopard that does not have this problem, files open with a double click.
    On my troubled machine the thousands of files in question opened yesterday, pre Snow Leopard. I have found a few PS files that are several years old that do open to a double click.
    Thoughts?

    In a partial answer to my own question...
    I have discovered that the Adobe CS2 files (as well as Illustrator CS2, Microsoft Office X, Silo, etc.) will open with a double click in some cases.
    Files on my main hard drive (Mac pro dual quad with four one terabyte hard drives, Snow Leopard 10.6.1) is a RAID made up of two of the internal terabyte hard drives will not open with a double clip. (They do open via the file menu in the given program).
    But files on non-RAID drives open with a double click as expected.
    It appears that the RAID drive (Apple software RAID) is the culprit.
    It is likely that a simple fix from Apple in the operating system to correct the opening of files with a double click from an Apple sotware RAID drive would solve the problem as the various programs all work fine otherwise with Snow Leopard 10.6.1.

  • Premiere Pro cs5.5 will not open after double-clicking icon

    I have uninstalled and reinstalled from disk.  I double-click the icon and the opening screen begins and then closes down.  I've run windows update to make sure everything is up to date and it still will not open.  Any suggestions on what to do?

    I don't think that is a graphics adapter, that is an I/O device... from what I have read
    --Windows 7 click START and look on the right side
    --Go to Windows Control Panel from START popup
    --NOTE that I do not have Win8 so can't give instructions
    --Click Hardware and Sound and then click Device Manager
    --Click the + sign at Display Adapters
    --Right click the display adapter and select Properties
    The "usual" is some model of ATI/AMD or an nVidia adapter
    I have nVidia GTX285 with driver 296.10

  • Files not opening on double click (Gnome)

    That is the problem im having.
    Im using a virtual Arch (virtualbox) via RDP ... all the system is fine. The only thing not working is that whenever i double click on any document//picture/archive it does not open it's default app....
    I dont think is something to do with the RDP protocol because if i open the mouse settings manager, where you have a small zone for testing the double click actions (the small bulb that lights on/off when you double click) the test shows that the system is actually detecting a double mouse click.............. is there any global settings, in gconf-editor, perhaps, where i can correct this?
    thank you!

    Solved: I had nautilus-elementary from archlinux.fr
    I did: pacman -Rd nautilus-elementary
    then:
    pacman -S nautilus
    All working again....

  • Installer for Adobe AIR does not respond when double-clicked?

    I tried to install Adobe AIR on my laptop (WinXP Professional, SP3), but the link at http://get.adobe.com/air/ didn't work - website said 'downloading' and to click OK when prompted, but I never got prompted.
    So I found an alternate site, downloaded the installer and double clicked to run it. Nothing happened. So I tried a couple more times before checking my Task Manager.
    Under 'Processes', there were several instances of the Adobe Air Installer.exe running, but nothing was happening that I could see!
    I'm not sure if it's a conflict with any other software or insufficient system requirements, but I'm pretty sure I'm not doing anything wrongly, cos I managed to successfully install Adobe AIR on another laptop I have, also running WinXP, and got Tweetdeck to work on it.
    Would appreciate any help on this matter from the more enlightened.
    Thanks in advance!

    Are you sure that you don't have Private Browsing enabled when Firefox is opened? <br />
    Tools > Options > Privacy = '''Automatically start Firefox in a private browsing session'''
    With that setting selected there is no (Private Browsing) showing in the Title bar.

Maybe you are looking for

  • Problem in Search Help Exit

    Hi Experts, I have aproblem in Search help Exit. I have added tab to the standard search help by creating elemntry search help and assigned that search help to standard search help. I am calling function module for search help exit. I dont have any s

  • Why do I get message that Flash player is in use and can't be installed even though I have uninstalled it?

    Using Windows7, attempting to install Flash Player version 17.0.0.134 I download the installer, specifically from the site for Firefox, and uninstall previous version and yet I get this message. Have tried several times to update and now to do new in

  • Mensaje error disco

    Hola. De repente no he podido abrir un archivo psd y me sale este mensaje: "No se ha podido cumplir porque ha habido un error de disco". Lo curioso es que puedo ver la vista previa del archivo. (Adobe cs5 extended). El resto de los archivos si los ve

  • USB of my iMac 3G Too slow HELP!!

    I received and old imac 3g from my brother. Now I'm using it as a "media center" for my apple TVs and Macbook. It was connected to a HD of 500Gb via firewire, but it got full. So I replace it with a HD of 1Tb (Westbook), but via USB. The iMac Reads i

  • Error message based on text in a drop-down menu...

    So I have a simple number field and a text drop-down box (with, let's say, the values "Blue", "Red" and "Green".) I want to set a minimum and maximum (say between 5 and 20) value on the number field and send an error if the user enters a number outsi