1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating a java program that acts like a normal windows executable?

Discussion in 'Java' started by rolls, Aug 5, 2009.

  1. rolls

    rolls New Member

    Joined:
    Mar 12, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I know you can compile java programs into a single .jar file that you can execute but I have a problem and I want to know if it can be solved.

    Now I have a custom file format that has the extension .dta the files contain some data to create a graph. Now I want to be able to double click these files and have them open in my java program. Also if the program is already open I want any further files that are opened (not via the file > open functionality) to open in this same instance of the application.

    How can I do this and what would be the best way. Should I use a separate launcher application written in say C# that calls the java -jar application.jar filename? Or is there an easier way to do this.

    Thanks in advance. :)
     
  2. rolls

    rolls New Member

    Joined:
    Mar 12, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I don't think I've ever got a helpful reply from this forum ever.

    Don't think I will be coming back.
     
  3. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Joined:
    May 5, 2009
    Messages:
    1,343
    Likes Received:
    55
    Trophy Points:
    0
    Occupation:
    STUDENT !
    Location:
    Orissa, INDIA
    Home Page:
    Well, suppose you made a C# launcher, how would you pass the path to .dta as an argument to your jar ??

    If you know how to do that, then you can set up a file association in Windows Registry Editor for your dta files.

    [comment]Have been helpful to the forum, yourself ?
    How many people have you helped ?
    Your post count is so low ... 5 posts since Mar 2009 !
    Forums are for sharing, not extracting.

    Still, the final decision of coming back or not is yours ...
    [/comment]
     
    Last edited: Aug 16, 2009
  4. Deepkamal singh

    Deepkamal singh New Member

    Joined:
    Aug 7, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    well...... if JVM or JRE is installed i assume %JAVA_HOME% will be set, if not , then Java.exe of JDK or JRE should be in %PATH variable...
    using which you can bundle a BATCH file and your class files in one executable ZIP double clicking on which should start BATCH file,

    now u can use windows file association to associate your .dta files with same batch file....

    now the problem of single instance should handle all "double clicked" dta files,,,, well..... make your classes in SINGLETON pattern,by which i mean making a static class which once invoked should read argument and associate doubleclicked file with some data str stack of singly running CLASS file,
    oracle installer is JAVA based, and hey there are lot of open source projects like eclipse ... hope u find right path....
     
  5. devunion

    devunion New Member

    Joined:
    Sep 26, 2008
    Messages:
    19
    Likes Received:
    2
    Trophy Points:
    0
    You can find correct solution here.
     

Share This Page