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. :)
Creating a java program that acts like a normal windows executable?
Started by rolls, Aug 05 2009 05:06 AM
4 replies to this topic
#1
Posted 05 August 2009 - 05:06 AM
|
|
|
#2
Posted 05 August 2009 - 05:45 AM
a .bat file should do as well I guess, on windows, then just register the extension in windows registry as usual.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#3
Posted 05 August 2009 - 05:57 AM
A batch file looks so ugly and unprofessional though. Also how would it allow further files to be opened in the same window?
#4
Posted 05 August 2009 - 07:16 AM
jEdit is an example of registering the entire command as the "associated executable". You associate "java -jar [myfile].jar %1" and have your jar able to read the command-line parameters.
#5
Posted 05 August 2009 - 07:32 AM
Hmm I guess I could do it that way, I don't like how the black command window pops up though, if I could stop that from happening I would accept that as a solution. Also how could I get new files to open in the existing java window and not load a separate instance of it?


Sign In
Create Account


Back to top









