views:

102

answers:

4
+1  Q: 

Java Deployment

When deploying a Java application, can I assume that every computer has java, and so is able to run my application? I've just created a java app, which works on my computer, but my boss (who generally uses .NET) claims it doesn't work at all. Should I assume that this will happen often, or will most consumers have java?

+1  A: 

I think that you should provide to your users a way to download/install the jre (probably a link) with a friendly message explaining the need to install it. Java is widely use.

NOTE In example, following is an example of the applet tag:

<applet code=Applet1.class width="200" height="200">
Your browser does not support the <code>applet</code> tag.
</applet> 

If you are deploying your application in a traditional way, there are some java application installers that handle it for you.

I hope it helps you.

Aito
That's a good idea. I'm still new to Java - any ideas how to check for a JRE? Thanks
chama
That's what I do - a link to http://www.java.com/en/download/help/testvm.xml to test the JRE version for being most recent and allow you to install/upgrade.
Software Monkey
@Software Monkey: good one!
Aito
And for what it's worth, I have never had a need for a *maximum* or *particular* JVM, only ever one that is *at least x*. That is I have apps coded for Java 2, 3, 4, 5 and 6 and they all work just fine on later versions. Java has been *incredibly* good with backward compatibility since 1.2.
Software Monkey
A: 

There are a number of solutions. You should not assume that everyone has Java installed. You can use web start for instance which will help with the setup. You can find some advice here.

More info about web start here.

Vincent Ramdhanie
+1  A: 
sateesh
A: 

You can also deploy a jre along with your application. Many 3rd party applications do this to ensure that the proper version of Java is available on the system. There are pros and cons with each approach.

You will want to refer to the license information about redistributing the jre contained in the jre folder ( e.g C:\Program Files (x86)\Java\jre6\README.txt - or wherever your install is ) to ensure you follow the proper procedures.

Rob Goodwin