Hello,
Forgive me if I have chosen the wrong thread for this question, but it was not obvious that it fit in any of the other threads.
I have written an applet that communicates with some form data via JSObect, executes a shell script with arguments, and then returns the output of the script to the page. I developed it on Mac OS X 10.4 using Apple's JDK 1.5. It works fine on systems using 10.4 - 10.6, both in Firefox and Safari, but will not work on 10.3.9. I tried it on 3 different computers with the same results, does not work in either of the aforementioned browsers.
It does not work on Firefox in Windows XP either. Was not able to test it on Explorer, as I could not open local files for some reason.
The dialog opens to query signing acceptance, I accept, and I just get an "Applet xyz not inited" error in the status bar.
Here is some info I took from the Macs with 10.3.9 (the ones that didn't work):
About This Mac > Applications
Java 1.3.1 Plugin Settings 2.0.0
Java 1.4.2 Plugin Settings 2.3.0
Java Web Start 2.3.0
From running "about:plugins" in the Firefox browser window:
Java Embedding Plugin 0.9.6.4
Application/x-java-applet;version=1.4.2
Application/x-java-applet;version=1.5
From running http://gemal.dk/browserspy/java.html:
Firefox:
Java enabled Yes
Java supported Yes
Java version Yes - version 1.6.0
Safari:
Java enabled Yes Yes
Java supported Yes Yes
Java version Yes - version 1.5.0 Yes - version 1.6.0
Some input on this matter would be greatly appreciated. I have combed the web looking for answers but have found none. This is my first Java experience, and so I realize that the solution is probably elementary, but to one so inexperienced, it is hard to know what to look for.
I wrote a test program which is a stripped down version of what I am trying to accomplish, for simplicity in analyzing the code. I get exactly the same results:
(note, this is all run on a local machine with no network connection)
import netscape.javascript.*;
import java.applet.*;
import java.awt.*;
import java.util.*;
import java.lang.*;
import java.text.*;
import java.awt.event.*;
import java.io.*;
public class JavaTest extends Applet {
public void init() {
JSObject win = (JSObject)JSObject.getWindow(this);
try {
String[] cmd2 = { "ls", "./" };
Process p = Runtime.getRuntime().exec(cmd2);
BufferedReader input =
new BufferedReader(new InputStreamReader(p.getInputStream()));
String scriptOutputLine;
while ((scriptOutputLine = input.readLine()) != null) {
win.eval("reportJavaMessage('"+scriptOutputLine+"');"); // REPORT
}
input.close();
}
catch (Exception err) {
err.printStackTrace();
}
}
}
Here is the html page launching the applet:
<html lang="en"><head>
<title>JavaTest</title>
<p>
<form name="counter">
<input type="text" size="20">
</form>
</p>
<style>
body {
font: 0.8em/145% georgia,times,serif;
margin: 200px 200px;
color: #242424;
background: #e6e6e6
}
input.text {
width: 350px;
}
</style>
</head>
<body>
<script type="text/javascript">
function reportJavaMessage(s){
document.forms[0].elements[0].value = s;
}
</script>
<applet code="JavaTest.class" codebase="./" archive="JavaTest.jar" mayscript width="1" height="1">
</body></html>
Edited by: Allasso on Dec 5, 2009 12:33 PM