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

rolls's Avatar
Light Poster
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.
0
rolls's Avatar
Light Poster
I don't think I've ever got a helpful reply from this forum ever.

Don't think I will be coming back.
0
SaswatPadhi's Avatar, Join Date: May 2009
~ Б0ЯИ Τ0 С0δЭ ~
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.

Offtopic 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 ...

Last edited by SaswatPadhi; 16Aug2009 at 19:43..
0
Deepkamal singh's Avatar, Join Date: Aug 2009
Newbie Member
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....
0
devunion's Avatar, Join Date: Sep 2008
Go4Expert Member
You can find correct solution here.