Launching java program via windows right click

I've written a Java Applicaton to display some data files we get from our cash registers. The app is stored in a jar file, with a manifest file. Double-clicking the jar file runs the program. Then we can select open from the file menu adn open our data files.
What I would like to add is the ability to right-click a data file in Windows, have the Java app appear in the Open With... menu in the popup menu, and then have windows launch the jar file.
I understand I would have to change the program to accept a parameter, and I know how to do that from the command line.
Is it possible to add a jar file to the popup menu in windows, and pass the path of the file into the main class in the jar file?
I did some Google searches this morning but couldn't find anything.
Thanks
Bill

Well purely speaking no. But then you can do most anything you like if you are clever with C++ and JNI.

Similar Messages

  • Opening a Word Document with a Java program in Windows

    When running a Java program in Windows, is it possible to have a button where when it is clicked it will open a Word document?
    If so, is it hard and can someone tell me how to do it??
    Thanks

    try this instead of Excel.exe you have to use Word.exe
    1. Declare your button
                   JButton butexlcom = new JButton("Carnet Offre");
                   butexlcom.addActionListener( new ButExlCommercial(msgout));
                   butexlcom.setBounds(215,510,110,30);
                   c.add( butexlcom );
    2. run your word document.
    class ButExlCommercial implements ActionListener {
         private JTextArea msgout;
         public ButExlCommercial( JTextArea msg) {
         msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
                   Runtime.getRuntime().exec("c:\\Program Files\\Microsoft Office\\Office\\Excel.exe NameWordDocument");
              catch(Exception en) {
                   msgout.append( "\n*** PROBLEME WORD ***\n" );
    }

  • I can't launch Safari. When I right click on the icon, the "Application not responding" is grey and no matter what method I use to Force quit, I get no response.

    I can't launch Safari. When I right click on the icon, the "Application not responding" is grey and no matter what method I use to Force quit, I get no response.

    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • Implemenation of windows right click key

    i want to know how is the windows application key alias windows right click key is handled in java .
    Is the functionality provided for the right click key in any of the java versions.
    If yes , how is it done ? what is its keycode ?
    If no , why what is the reason ?
    and Is there any work around to implement the right click key if there is no direct solution .

    Hi Rommie,
    Thanks for your kind information .
    I want to know how is the windows right click key or context key is handled through keyboard instead through mouse .
    I attempted to handle the Context key in Java in KeyPressed event. However, there is no specific key code . In Java, it returns a VK_UNDEFINED virtual key code. But, since the same VK_UNDEFINED is returned for other keys as well, say for Windows key or when using a Japanese key board, there seems to be no direct way to handle Context key in Java.
    I would appreciate if there is anyother workaround solution that you may be aware of to handle the same.
    Thanks in advance,
    Amar.

  • How to start java.exe from a java program in windows ?

    Hi,
    I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.

    Runtime.getRuntime().exec("java Sample");

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • How to run a java program in windows 2003 server from unix server.

    Hi ,
    I want to run a java program in windows 2003 server from unix machine ..
    will RMI helps me to obtain this.
    Please tell me the procedure to do this.
    Thanks in advance,

    rmi,web services,corba,web 2.0,xml,xls,dtd,rss,ruby on rails,https,soap,tags,blog,podcast,google

  • I want to run java program on windows environment as background process

    Hi all
    I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
    for example look this programe
    import java.io.*;
    import java.util.*;
    public class TestClass {
         class ravi extends Thread{
              public void run(){
                   try {    
                        String target_file = "ravind.txt";
                        File targetfile = new File(target_file);
                        PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
                   for (int i =0 ; i < 100 ;i++ ){
                        Thread.sleep(10000);
                        writer.println(" ravindra shukla ");
              } catch (Exception e) {               
                             e.printStackTrace();
         public static void main(String[] args) {
              TestClass test1 = new TestClass();
              TestClass.ravi r1 = test1.new ravi();
              r1.start();          
    System.out.println(" return from main ");
    first i compile this
    javac TestClass.java
    then i run this by using this command
    java TestClass
    but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java command

    Thanks dude
    This solution �start java TestClass� works fine �. But it does not solve my problem
    It opens another black window and that black window persist till the life time of my program
    Is it possible application run on complete background without opening another black window �as in Linux

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

  • How to read system evenlog using java program in windows

    How to read system evenlog using java program in windows???
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Welcome to the Sun forums.
    >
    How to read system evenlog using java program in windows???>
    JNI. (No.)
    >
    is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
    >
    Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
    Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb.

  • Deploying java program on Windows

    Hi,
    I have just finished developing a java program using the eclipse editor. I'm ready to deploy it to Windows XP platform. To my surprise, once I step outside of eclipse, nothing works (compling, executing, packaging)...
    Since Eclipse is obviously compiling and packaging the files using the same commands availiable to me from the commandline(java.exe, javac.exe, etc.), what I want to do is write a batch script that will compile the entire project, and another batch script that will execute the project. I might use jar file.
    My program consists of JDBC and many other library that I used( junit.jar, etc.). I have all the library pack in a dir and I use them in Eclipse by importing them as external jar. However, it seems like these library can't be recongize when I compile from the commandline. I tried to place them in my javaSDKdir\lib, but that didn't help. I ideally, I want everything to be in one package.
    I also tried to make a jar file in eclipse. After it's generated, I edit the MANIFEST.MF file and include my main class. However, when I launch the jar file(double click), nothing really happen. I know it can find my main class because if I change the MANIFEST file, it will complain main class not found.
    Any suggestion is welcomed. Thanks.

    A very good book that you should run, not walk, to the store and buy:
    http://www.amazon.com/exec/obidos/tg/detail/-/0974514039/qid=1122272721/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/104-9419035-6610351?v=glance&s=books&n=507846
    It will show you how to do everything you want to do, and a lot more. It's one of those books most developers should learn to live by, and sadly most do not. Between unit tests, build automation, continual integration builds and more, you'll find it in this book.
    Now, I recognize that you are probably somewhat new to java development given the difficulties you are having, so this book may seem overkill, but its a great place to learn what to do the right way fhe start.
    If $800 is not a terrible amount of money to spend, I'd strongly recommend Install4J. It will bundle your application with installers for mac osx, windows and linux, and provide native launchers as well, with a LOT of the drudgery usually involved in shipping/deploying a java application taken care of. If you are working for a company (or your own), I'd suggest you go that route to provide a good professional installation and launcher capability. If it's a free/open-source project, well, I'd still recommend it if you can afford it.

  • Issue with launching Java Program - Java Library Problem?

    I hope this is the right forum, I apologize if it isn't. I am having issues launching a program for a video game that uses java. One of the devs told me to post my issue here, as he doesn't know how much more help he can give with this issue. Using the java -jar command, this is the printout I get:
    Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
    C:\Users\vecdran>java -version
    java version "1.6.0_20"
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
    C:\Users\vecdran>chdir C:\Games\Steam\Steamapps\common\Crysis\mods\mwll\actionma
    pper\dist
    C:\Games\Steam\steamapps\common\crysis\Mods\mwll\Actionmapper\dist>java -jar Act
    ionmapper.jar
    Jun 18, 2010 2:25:19 PM org.jdesktop.application.Application$1 run
    *SEVERE: Application class mwllactionmapper.MWLLActionmapperApp failed to launch*
    *java.lang.NullPointerException*
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFo
    lder(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
    s(Unknown Source)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
    n Source)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.swing.JFileChooser.updateUI(Unknown Source)
    at javax.swing.JFileChooser.setup(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLDocumentsFolder(Act
    ionmapsFileModel.java:141)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLProfiles(Actionmaps
    FileModel.java:160)
    at mwllactionmapper.MWLLActionmapperView.doSelectProfile(MWLLActionmappe
    rView.java:603)
    at mwllactionmapper.MWLLActionmapperView.<init>(MWLLActionmapperView.jav
    a:75)
    at mwllactionmapper.MWLLActionmapperApp.startup(MWLLActionmapperApp.java
    :21)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class mwllac
    tionmapper.MWLLActionmapperApp failed to launch
    at org.jdesktop.application.Application$1.run(Application.java:177)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFo
    lder(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponent
    s(Unknown Source)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknow
    n Source)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.swing.JFileChooser.updateUI(Unknown Source)
    at javax.swing.JFileChooser.setup(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at javax.swing.JFileChooser.<init>(Unknown Source)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLDocumentsFolder(Act
    ionmapsFileModel.java:141)
    at mwllactionmapper.model.ActionmapsFileModel.getMWLLProfiles(Actionmaps
    FileModel.java:160)
    at mwllactionmapper.MWLLActionmapperView.doSelectProfile(MWLLActionmappe
    rView.java:603)
    at mwllactionmapper.MWLLActionmapperView.<init>(MWLLActionmapperView.jav
    a:75)
    at mwllactionmapper.MWLLActionmapperApp.startup(MWLLActionmapperApp.java
    :21)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    ... 8 more
    C:\Games\Steam\steamapps\common\crysis\Mods\mwll\Actionmapper\dist>As you can see, my Java is completely up to date, and this is the only program I appear to have problems launching. I have no idea what to do from here. :(
    PS.
    I had to add the Java path to my System -> Environmental Variables -> Path variable, as it was not there from the start, and before adding it command prompt wouldn't recognize java commands. Don't know whether this indicates anything.
    Edited by: vecdran on Jun 20, 2010 11:23 AM

    [Bug ID 4711700|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4711700] is eerily similar to what you're experiencing. Although the bug was reported against an older version of the JDK the last comment provides a workaround to the problem that may be helpful. Good luck.

  • To run a java program on windows xp startup

    hi ,
    i have a sample HelloWorld.java program.
    i wrote a batch file to run this program as follows:
    set PATH=%PATH%;C:\Program Files\Java\jre1.6.0\bin;
    cd c:\test
    java HelloWorld
    This program runs when i click on the bat file.
    Next i add this batch file to registry to auto-start on windows startup
    However, on windows startup, i get the following:
    Exception in thread "main" java.lang.NoClassDefFoundError
    Anyone can help me? Thank you in advance!

    Hi Sergi,
    Thanks for the info. I couldn't able to login because of my internet connection.
    Thanks,
    --Srini                                                                                                                                                                                                                           

  • Running a Simple Java Program in Windows 7

    Hello:
    Learning Java.
    I have Windows 7 64 bit. I have following Java installed:
    C:\Program Files\Java\jdk1.6.0_21\demo>java -version
    java version "1.6.0_21"
    Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
    Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)
    My path is as follows:
    C:\Program Files\Java\jdk1.6.0_21\demo>path
    PATH= C:\Program Files\Java\jdk1.6.0_21\bin;C:\Windows\system32;C:\Windows;C:\Wi
    ndows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files
    (x86)\QuickTime\QTSystem\
    When I try to run a program called Exampleprogram.java as follows, I see below error:
    C:\Program Files\Java\jdk1.6.0_21\demo>java exampleprogram.java
    Exception in thread "main" java.lang.NoClassDefFoundError: exampleprogram/java
    Caused by: java.lang.ClassNotFoundException: exampleprogram.java
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: exampleprogram.java. Program will exit.
    C:\Program Files\Java\jdk1.6.0_21\demo>
    Will appreciate your early help. Thanks.
    Victor

    Recomplied and still no luck. I gave a different name to the program and still getting the same error as follows:
    C:\Program Files\Java\jdk1.6.0_21\bin>dir hel*
    Volume in drive C is WINDOWS7PRO
    Volume Serial Number is EB0E-8900
    Directory of C:\Program Files\Java\jdk1.6.0_21\bin
    10/03/2010 11:29 AM 269 helloworld.java
    10/03/2010 11:33 AM 429 HelloWorldApp.class
    2 File(s) 698 bytes
    0 Dir(s) 123,998,978,048 bytes free
    C:\Program Files\Java\jdk1.6.0_21\bin>java helloworld.java
    Exception in thread "main" java.lang.NoClassDefFoundError: helloworld/java
    Caused by: java.lang.ClassNotFoundException: helloworld.java
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: helloworld.java. Program will exit.
    C:\Program Files\Java\jdk1.6.0_21\bin>
    Thoughts please.

  • Bridge no windows right click after upgrade to cs6

    Win7 x64 - production premium 5.5 upgrading to 6
    I use to right click on a folder in windows and choose, "browse in bridge."
    This is now gone. Also all of my file associations were gone.
    It's super easy to fix the file associations, but how do I get my right click menu back? Browsing to a folder in bridge is not enjoyable.

    1. Run regedit.exe
    2. Navigate to "My Computer\HKEY_CLASSES_ROOT\*\shell" and select "shell"
    3. Edit > New > Key
    4. Name it Bridge
    5. Make sure this new key is selected
    6. Edit > New > Key (again)
    7. Name it command
    8. With this key selected, double-click on the (Default) value in the righthand pane.
    9. enter: "C:\Program Files\Adobe\Adobe Bridge CS6 (64 Bit)\Bridge.exe" "%L"
    10. Exit regedit.
    Works for me

Maybe you are looking for

  • Import po for non valuated material

    hi sap guru's my client have one import po in that po material is non valuated at the time of MIRO for posting cvd ,custom, that time system not posting cvd,custom to approprit account (zcv account) they showing only vendor account and client want to

  • Cannot Create PDF Files

    Hello, I am using Windows 2000 Server as a Terminal Server and have Acrobat 6.0.1 installed. When I try to print anything (even a test page and even while logged in as administrator) I get the following error: There was an error found when printing t

  • Can't scan items as OCR in Reader 9

    When scanning in PDFs, I was told to go to Documents and then select OCR to view documents with character recognition. The only options I have under Document are Sign, Security, Security Settings, Manage Trusted Identities, and Accessibility Setup As

  • SAP ESS/MSS Functional Guide

    Hello Experts, I am new to ESS/MSS, so can anyone provide me with a proper Functional & Technical guide on ESS/MSS, also it would be great if you all provide me with a specific configuration guide on installing ESS/MSS. I have already searched some f

  • OSX recovery software

    What recovery software have you used? Would you recommend it?