Double clicking jar executables

Hi everyone
I know that this topic has been discussed before - but I have scanned all discussions, and the problem hasn't been solved yet. There have been some good suggestions, but no definitive solution provided.
I have a jar executable supplied to me by a commercial software company. The application is packaged in a jar file. I have checked that the manifest has the correct Main-Class association in it. I can install the jar on some Win 2000 copmuters and it executes fine by just double clicking on the jar file. On my laptop which also has Win 2000 OS it simply refuses to execute. The very frustrating JVM Launcher error message "Could not find main class. Program will exit." is displayed.
The only way that I have found to get around it is to put a batch file in the same directory as the jar file containing "start /MAX javaw -jar "C:\Program Files\EqWave\eqwave181\eqwave.jar"" and execute this batch file from a shortcut placed on the desktop. Not a very good work-round - but at least it works.
What I can't figure out is why the jar will work when double clicked on some computers, but not on my laptop. Obviously it has something to do with my laptop setup.I have reinstalled the latest jre-1_5_0-windows-i586.exe, but it still won't work.
Please, please, pretty please - what am I doing wrong?????
Cheers
Mike T

On your laptop the file association could be wrong : check if the file association with .jar is "javaw -jar" and not only "javaw".
It looks like the "-jar" option is missing in the command field of your file association...
On my Windows 2000 computer, the file association for .jar is :
"C:\Program Files\Java\j2re1.4.1\bin\javaw.exe" -jar "%1" %*Modify your file association and I bet it will be better.

Similar Messages

  • Can't write to file when double-clicking jar...

    This issue has me stumped. I have a jar dssetup.jar... The manifest looks like the following...
    Manifest-Version: 1.0
    Main-Class: DSsetUp
    Created-By: 1.3.0_02 (Sun Microsystems Inc.)
    I also have a text file that I read and write to(this file is outside the jar):
    datasource.txt
    If I execute my jar from the command line, I can read and write to the file...no problem. However, if I double click my jar to run it, I can read the text file but cannot write to the text file. Has anyone seen this before?
    Thanks

    It is true ..
    you can not write anything to .jar file directly..
    .jar file is not a common file, it is compressed.
    the following tool give you some cue.
    tool named JavaJar(written by java) can compress and decompress jar,war, ear and.zip...
    may download from http://www.qwerks.com/download/4114/JavaJar.zip
    the tool is very verygood tool.
    but the homepage(www.pivotonic.com) of JavaJar cannot be accessed.
    it is funny.
    good lucky.

  • Double clicking .jar file does nothing!

    Hello i am wondering, how to run a .jar file by double clicking it?
    After creating the jar file and by typing javaw.exe -jar ledger.jar in command prompt in windows 7 works fine for my swing application.
    I created a .bat file which has javaw.exe -jar ledger.jar also works fine.
    But when i double clicking the ledger.jar is not working, not giving any error, not even doing anything.
    I tried associating .jar file with java or javaw then also nothing happens.
    My questions are:
    1) What i have to do to execute the .jar file by double clicking it?
    2) Why java is not so user friendly to the end users especially in Desktop Applications?
    Thanks in advance.
    Note: OS - Windows 7 64 bit
    JRE - 32 bit in Program files (x86) folder version 7

    handat wrote:
    Your other question, please blame Microsoft for not making file associations easier to manage.Too easy. You can blame MS all you want; it is the task of the Java runtime installer to properly setup the file associations - OR the administrator which bypasses the runtime installation with his own scripts. i have installed the runtime many times including on Windows 7 and it always does it properly. I have no clue how people end up with half-finished installations.

  • Can't Double Click Jar in Fedora 2 Core

    Hi,
    Have a Jar that works in XP and was created with Ecliplse 3.
    I can double click the Jar File and it works great.
    I even compiled with Jet Excelsor to and EXE and it works great.
    Installed Java 1.4.2 SDK with Net Beans onto Fedora 2 Core OS, final release.
    Copied the Jar over using the Fat32 partition.
    I get a JAR looking ICON for the file, but double clicking on the Jar does nothing (as far as I can tell)
    When a user gets the JAR, it could be located in ANY directory.
    Anyone solve this or have this problem?
    I been looking at the JAR documention, and not finding anything that I know about that could relate.
    Thanks

    Does
    java -jar <jarfile>
    work?
    YES: Main-Class is set correctly in manifest, its just that the SDK for the Fedora 2 OS doesn't support double clicking.
    NO:
    Does
    java -cp <jarfile> <mainclass>
    work?
    YES: Main-Class is set incorrectly
    NO: Jar might be corrupted during transfer, try to unzip or unjar it.

  • Double-click C executable

    hey guys.
    I don't have a Mac, so I need your help here. If, on Mac OS X, one write some C code, then compiles it with
    Code:
    gcc -o binaryfile code.c
    then puts binaryfile on the Desktop and double-clicks it, what will happen? Will in run as if you typed
    Code:
    ./binaryfile
    on the command line?
    What if binaryfile doesn't have execute permissions set? What happens whet it gets double clicked?
    Thanks for help

    I don't know what the rules are, but double-clicking a compiled binary executable file (but not a script) will often cause "Terminal.app" to launch, a new shell to open, and the executable to run, as if it was called from the command line. This applies to things like the actual executable files in the "MacOS" folders at the heart of applications, and many of the things in places like "/bin". Similarly, "X11.app" launches for things in eg: "/usr/X11R6/bin".
    I'm not a programmer, but the few times I have compiled things with gcc, the binary file behaved the same way, i.e. double-clicking it was more or less the same as entering './binaryfile' in "Terminal.app".
    If the binary file is not executable, "Terminal.app" or "X11.app" still launches, but nothing happens.
    So somehow, the launch services seems to know whether or not a file is... (what? a "Mach-O executable"?) regardless of whether the executable bit is set, and can discriminate between those that should open with "Terminal.app" or "X11.app". I suspect it would be possible to override this association through launch services (eg. via "Get Info") so it probably wouldn't be a good idea to rely on it, depending on what you had in mind.

  • Xcode executable execution working directory on double-click

    I have a fairly simple C++ code that I made with Xcode 3.1. It compiles fine and works if I run it from a terminal. But, if I double-click the executable, it launches and is looking for some supporting, local files at my "Macintosh HD" directory level instead of in the folder I launched it from (output files are also placed at that directory level). All file paths in the code are relative.
    Is this a compilation issue or option that I can change in Xcode? How do I make it so I can also just double-click the executable?
    Thanks,
    John

    Double clicking actually executes Terminal with root as current directory which then runs your C code. Change your code to look at the path in arg and use it to access the supporting files.

  • Iview calling R/3 transaction with double click to call url

    Hello,
    I have create a bespoke transaction that displays EH&S incidents, the user has the option to double a line which calls a web dynpro and displays in a new window. (FM CALL_BROWSER is used to open the URL)
    This functionality works in R/3, if a user double clicks 1 item a new window opens and when he double clicks another item an new window opens as expected.
    However when this action is carried out in the portal using the iView, the first time the user double clicks and item a new window opens, but when another double click is executed, no new window is opened.
    To me this sounds like a setting is missing in the Iview (by the way, this is my first time using iViews, so be gentle) or something is not being cleared.
    any help would be appreciated.
    Regards
    J-J

    Hello James....
    This might sound stupid to you...but just I need to suggest one thing...
    This happens if you double click on a link...it opens a new window...
    now before you double click a new link.....you need to close the earlier window....
    then only new window will be opened....
    well this happened once to me...so i thought to suggest the same to you also...
    but their are minimal changes that this could be the reason.....

  • Double clicking an intensity graph to call an event

    I am trying to make a certain sequence of events happen if a user double clicks an intensity graph. I didn't notice a 'double click event' just mouse up and downs. Is there a way to recognize a double click if it occurs within a pixel range or on an intensity graph?

    Hi.
    Indeed, there is no built in event to catch a double click, but you can use any of the "single click" events to build yourself your own double-click detector, as shown in the attached VI. What I do there is set the value of a shift register to 1 when there is a mouse down? event and the shift register had a value of 0 (first click). If there is another mouse down? event before the timeout (which you can set to whatever you want), I consider that a double click, and execute whatever code you want for a double click. If the timeout passes, the user didn't click twice on the graph fast enough to be considered a double click, so the shift register is set back to 0.
    Attachments:
    DetectDoubleClick.vi ‏35 KB

  • Hierarchial List double click Event

    Hi Friends,
    I have developed a Heirarchial List using Function Modules.
    My requirement is when i double click on items(child) it has to go to a sap standard transaction.
    But Double clcik event is not working when i double click on any item. Can anybody pls  give me an idea
    how to achieve this?
    Thnaks in Advance.
    With regards,
    Rajgopal

    Dera friend,
                      follow the below mentioned code . hope u will undersatnd.
    Here is the procedure to handle Interactive ALV.
    1. declare events table like this.
    data :
          i_events  type slis_t_event,
          w_events  like line of i_events.
    2.
    Build events table .
    w_events-name = 'USER_COMMAND' .
    w_events-form = 'USER_COMMAND' .
    append w_events to i_events.
    clear w_events.
    3.
    pass this events table through REUSE_ALV_GRID_DISPLAY.
    4.
    USER_COMMAND call back subroutine should be like this in your case. This is nowhere called using PERFORM statement in ur program.
    5.
    USER_COMMAND subroutine should be like this.
    *&      Form  user_command
    form user_command using ucomm like sy-ucomm
                      selfield type slis_selfield.
      case ucomm .
        when '&IC1'. This is for double click on ALV output.  
       skip 10.
          position 10.
          write 'Double click was executed'.
      endcase.
    endform.                    "user_command
    selfield structure
    You can also handle Interactive ALV using this structure.
    types: begin of slis_selfield,
             tabname              type slis_tabname,
             tabindex             like sy-tabix,
             sumindex             like sy-tabix,
             endsum(1)            type c,
             sel_tab_field        type slis_sel_tab_field,
             value                type slis_entry,
             before_action(1)     type c,
             after_action(1)      type c,
             refresh(1)           type c,
             col_stable(1)        type c,
             row_stable(1)        type c,
           colwidth_optimize(1) type c,
             exit(1)              type c,
             fieldname            type slis_fieldname,
             grouplevel           type i,
             collect_from         type i,
             collect_to           type i,
           end of slis_selfield.
    You have to check the above structure in debug when u double click what the above contains. very helpful structure fo ur case.
    regards,
    PrashantH maturu.

  • Double click on JAR file to execute it.... How???

    Hello,
    I wrote a standalone java application, and im wondering how to put a shortcut on my desktop to run the application without having to go into the command prompt to type "java -jar MyProgram.jar".
    I want to be able to just double click on it and have it run. Is there a way to do this?

    Here is how I did it:
    Just install the JDK/JRE and then make a shortcut to the jar file you want to execute. When you install the jre jar's are registered and all you need do is double click them. I've done this in windows 95, 98, Me, NT, and Win2000.

  • 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

  • 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

  • Issue with .jar file (double clicking)

    Hi.
    I've been having a problem with a certain .jar file when I attempt to double click it. From my understanding, I was under the impression that when someone double clicks a .jar file, the contents are supposed to execute by itself (kind of like a .exe file, I guess?)
    I've been able to successfully create my .jar file and have been able to run it through a command prompt in Windows using the following:
    java -jar testjar.jar
    However, whenever I try to double click on the testjar in the folder it is located in, a command prompt quickly pops up and goes away. I've been able to tell I'm getting an error, mainly consisting of something along the lines of "Exception in thread "main" java.lang.NoClassDefFoundError: ...
    I'm not entirely sure what information is needed for support, but I'd be more than happy to provide what is necessary. Thanks in advance!

    I've been having a problem with a certain .jar file when I attempt to double click it. From my understanding, I was under the impression that when someone double clicks a .jar file, the contents are supposed to execute by itself (kind of like a .exe file, I guess?) Only if it has a manifest file which specifies the main class
    java -jar testjar.jar
    However, whenever I try to double click on the testjar in the folder it is located in, a command prompt quickly pops up and goes away. I've been able to tell I'm getting an error, mainly consisting of something along the What does your program do? It's possible that it runs and then closes before you can notice when you double click. It's also possible that the java version that double click is invoking is different from what you're using on the command line.

  • Running .jar files in linux on double click

    Hi,
    i needed a solution to run the jar files on double click in linux system.Necessity is mainly because when i run the jar file by java -jar myapp.jar in terminal it works fine .Iam running my app continuosly in system tray(a server kind).But if i close the terminal my app exits.
    How to resolve this ?

    I am taking a SWAG.....it sounds like your problem is how to run a java app without a terminal window. So as I recall, there is some way in Linux to enter a command and have it execute in a new process. I don't recall the syntax but maybe putting a '&' character in the command line? Anyway, you should be able to use the method and use "javaw" instead of "java" to launch your app. You should be able to do this in a batch file too. Something like, javaw -jar yourjar.jar &

Maybe you are looking for