Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Creating a java program that acts like a normal windows executable? (http://www.go4expert.com/forums/creating-java-program-acts-normal-t18834/)

rolls 5Aug2009 18:26

Creating a java program that acts like a normal windows executable?
 
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. :)

rolls 16Aug2009 19:15

Re: Creating a java program that acts like a normal windows executable?
 
I don't think I've ever got a helpful reply from this forum ever.

Don't think I will be coming back.

SaswatPadhi 16Aug2009 19:34

Re: Creating a java program that acts like a normal windows executable?
 
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 ...

Deepkamal singh 17Aug2009 16:16

Re: Creating a java program that acts like a normal windows executable?
 
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....

devunion 17Aug2009 17:28

Re: Creating a java program that acts like a normal windows executable?
 
You can find correct solution here.


All times are GMT +5.5. The time now is 04:35.