Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Efficient way of distributing java application

843807Jan 23 2003 — edited Feb 21 2003
Hi,
I have a java application that I can startup using the command

java appName

Now I want to be able to distribute this application. I have a few questions for that:

1)
How can I check if Java Runtime Environment is already installed or not? If it is I want to skip step 2. I cannot do this from java for sure because I am not sure if JRE is available or not.

2)
Assuming that the client PC does not have java installed on it, how can I automate the installation of Java Runtime Environment and after that install the java application.

3)
Also is there anyway I can go around without having to type the following to start my app?
c:\>java appName


Thanks
-Chirag

Comments

843807
3)
Also is there anyway I can go around without having to
type the following to start my app?
c:\>java appName
Make an executable Jar File, assuming you are in a Windows environment.

843807
Wouldn't I still have to type --

C:\>java -jar fileName.jar

??
843807
No, you can doubleclick the .jar file and it is run by java virtual machine. Installing a java runtime (or sdk) will associate .jar extension to virtual machine. This is a windows-only feature however.
843807
Not true! Executable JARs work on Solaris as well. I think they might also work on Mac OS X. And all systems can simply do "java -jar myjar.jar" instead of the evil "java -cp myjar.jar com.mydomain.myprog.MyProgram".
843807
I personally like building applications like Eclipse. I have my own plugin engine I am developing, and prefer to develop plugins. It is nice because auto-updating of plugins can easily keep people up to date with the latest plugins, plus it makes your application highly extensible (if you publish your APIs), so that others can add new features to it, making it more robust. My engine is pretty small, only 20K with xml parser. When it is finished it will probably be around 50K or so. I am aiming for it to be a generic engine so that it could be used in small devices, wireless stuff, etc allowing for a solid extensible architecture to build software upon for any device.
843807
Hi buckman1,

would you please post a link to more information about the software you mentioned (i.e. Eclipse)?

Another simple answer for the problems of the original poster is JNLP and Sun's Java Web Start.

Best regards,
Martin
843807
Really happy to see other Eclipse fans :)
Here's where you should go to http://www.eclipse.org
and also to http://eclipsewiki.swiki.net/1 for more "user-friendly" help!
Oh and also to http://eclipse-plugins.2y.net/eclipse/index.jsp for finding the plugin you need or contributing one :)
843807
Hi,
I have a java application that I can startup using the
command

java appName

Now I want to be able to distribute this application.
I have a few questions for that:

1)
How can I check if Java Runtime Environment is already
installed or not? If it is I want to skip step 2. I
cannot do this from java for sure because I am not
sure if JRE is available or not.
There was a similar post at
http://forum.java.sun.com/thread.jsp?forum=422&thread=343622&tstart=0&trange=100
843807
Hi,
I have a java application that I can startup using the
command

java appName

Now I want to be able to distribute this application.
I have a few questions for that:

2)
Assuming that the client PC does not have java
installed on it, how can I automate the installation
of Java Runtime Environment and after that install the
java application.
Please refer to reply#3 of a similar post at
http://forum.java.sun.com/thread.jsp?forum=422&thread=319499&tstart=0&trange=100


Hope this helps.
Regards,
Nirmalya
843807
I personally don't like WebStart/JNLP. I think it is a valid attempt but not nearly as controllable on a per application level for my tastes, hence why I like Eclipse and such applications. I can't explain why in a good way, I just don't like other "unchangeable" frameworks controlling how my code is delivered. Kind of contradictive since I am developing a generic plugin engine similar to eclipse for others to use. :)

www.eclipse.org
This is probably the fastest growing IDE right now, with IBM being the major developer behind it, but many large vendors (Rational, Oracle, Borland, and so forth) adding support for it. It is pretty full featured, free and fairly simple to add plugins to.
843807
can anybody post a link on how to excatly make a 'double clickable' jar executable for Windows platform

pradeep
843807
can anybody post a link on how to excatly make a 'double clickable' jar executable for Windows platform

pradeep
843807
I think Sun should have defined another name for executable
jar files, for example .japp, .jexe or .jxe and used the .jar
name only for archives, class libraries, etc.

To make a .japp file from a .jar file you would have to add
a properly formatted manifest file, preferably using some tool
which would check the manifest.

The java executable could be modified to interpret
java abc.japp
the same as
java -jar abc.japp (or java -jar abc.jar currently)

This would make deployment (on windows at least) much
easier than it is now. The Java install would register
.japp as belonging to java.exe and when the registry
is damaged (as the junk invariably will) you can
reassign the association in the "Open With..." dialog
without having to go deep in and add the -jar option.
843807
check in java documentation - tool - jar

it is mainly by creating a manifest file and put your main class name into that manifest

cheers

Tonny
http://www.kiyut.com
(Swing Component)
1 - 14
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 21 2003
Added on Jan 23 2003
14 comments
314 views