Deploying Applet Techniques

Hello everyone, I was wondering what the best way to deploy my java applet would be. I want it to be as easy as possible for the end-user to be able to get the required java plug-ins etc. Would Sun’s deployment toolkit be the way to go (http://java.com/js/deployJava.js) or are there any other solutions?

Please let me know any successes or failures you have has using this or other methods!

Thanks in advance… :slight_smile:

what version of Java do you target ?

Well it was going to be 1.6 but since ive found out (from the other thread i started here today) that 32bit macs cannot run any java 1.6 based stuff i will rewrite so it compiles on 1.5…

Just to update, ive just been messing around with the java deployment toolkit, and its hasent impressed me! It dosent work in Safari or Opera, which renders it a bit useless as a cure-all solution!

Developing for the web can sure be trying sometimes…

edit: I just read that opera dosent use the sun JVM, no opera users for me then!

-- Opera Java Console --

Java vendor: Sun Microsystems Inc.
Java version: 1.6.0_13

type 'h' for help

--

:wink:

there are probably more simple methods.

one way could be for example to use a 1.1 compatible applet that detect user Java version and open lastest java website if version is too low. you can complete that with some javascript in case the user dont have any JVM

in reply to the Opera status, i just read on another java.net forum a post from last year saying this about opera, is this untrue then?

That is my current solution, see the code below, im not sure what java version this is compatable with though, it didnt work on a 1.4.2 install…



import javax.swing.JApplet;
import netscape.javascript.*;


public class VersionDetectApplet extends JApplet {

	private String version = "?";
	
	public void init(){
		version = System.getProperty("java.version");
		System.out.println(version);
		JSObject win = (JSObject) JSObject.getWindow(this);
		Object[] arr = new Object[1];
		arr[0] = version;
		win.call("showJavaVersion", arr);
	}
	
	public String getVersion(){
		System.out.println("getversion called");
		return version;
	}
}


which calls some javascript to manipulate the page so the user can see the status.

Whats the best way to check compatability of code?

ah, i see that JApplet did not exist in 1.4.2, shouldve just made it applet in the first place i guess…

a question as i got this code from somewhere else and changed it a bit.

What does this import trigger


import netscape.javascript.*;

how does it know where to look for this code as i have included the .class files and it’s not in the JRE (is it?)

probably to test it on the wanted minimal JVM (or to ask someone to test it).

also when you compile if you want to make it compatible use “javac -source 1.3 -target 1.1 etc…” this way you will get a very compatible one that you can use to check user version

You don’t want to extend from JApplet for this simple test, it’ll pull swing code => bad for startup.

ok, have changed to applet instead of JApplet, i have compiled using java 1.5.0_17 and it works fine on all browsers apart form Opera on a machine with Java 1.6.0_13 installed, which i can cope with, but if a java 5 version is installed mozilla decides it doesent like it and outputs a JSException, whats going on!!

ah, solved about 3 seconds later, i hadent included the parameter, strange how that only seem to effect firefox on a java 1.5 machine, oh well…