Roedy Green said:
If you posted your code and your bat files we would not be playing
doctor in the dark.
I did once and I got mocked for doing so but if you prefer here it is.
package uk.me.g7wap.helloserver;
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.*;
import java.security.*;
import java.lang.*;
public class Helloserver extends Applet
{
private String hostname = "
http://g7wap.dyndns.org/";
private String protocol = "http://";
private String port="80";
private String buf;
private URL location;
private Object content;
private String tmpStr = "GET / HTTP / 1.1\r\n\r\n";//Accept:
*/*\r\n\r\n";//Accept-Language: en-gb\r\n\r\nXXXXXXXXXXXXXXX:
XXXXXXXXXXXXX\r\n\r\nUser-Agent: HelloServer 1\r\n\r\n";
private byte[] getStr = tmpStr.getBytes();
public void init()
{
hello();
}
public void paint(Graphics g)
{
g.drawString(buf, 50, 60 );
}
/**
* Method hello
*
*
* @return
*
*/
protected boolean hello()
{
String str,server;
byte[] ba = new byte[1024];
int bytesRead;
Socket socket=new Socket();
buf="";
try
{
// O P E N
socket = new Socket();
socket.setSoTimeout(3000);
socket.connect(new InetSocketAddress("10.0.0.254", 80),3000 );
}
catch(AccessControlException u)
{
buf=u.getMessage();
}
catch(MalformedURLException u)
{
buf=u.getMessage();
}
catch (UnknownHostException u)
{
return false;
}
catch(SocketTimeoutException u)
{
return false;
}
catch(IOException u)
{
}
try
{
InputStream is = socket.getInputStream();
try
{
OutputStream os= socket.getOutputStream();
try
{
os.write(getStr,0,tmpStr.length());
}
catch(IOException u)
{
}
}
catch(IOException u)
{
}
// R E A D
// -1 means eof.
// You don't necessarily get all you ask for in one read.
// You get what's immediately available.
bytesRead = is.read( ba, 0 /* offset in ba */, ba.length /* bytes to
read */ );
if (bytesRead!=-1)
{
System.out.println(bytesRead);
buf=new String(ba);
System.out.println(buf);
is.close();
}
}
catch(IOException u)
{
}
// C L O S E
try
{
socket.close();
}
catch(IOException u)
{
}
return true;
}
}
I trust you have code like this:
package uk.me.g7wap/helloserver;
no
package uk.me.g7wap.helloserver;
public class Helloserver
in a file called C:\uk\me\g7wap\helloserver\Helloserver.java
no the java is located elsewhre but the class is produced in
C:\uk\me\g7wap\helloserver\
so C:\uk\me\g7wap\helloserver\Helloserver.class
I trust you created your jar with some code like this:
c:
cd \
rem your main.mft should look like this:
rem Main-Class uk/me/g7wap/helloserver.Helloserver
rem following should be on one line:
jar.exe -cvfm
uk\me\g7wap\helloserver.jar
uk\me\g7wap\helloserver\main.mft
uk\me\g7wap\helloserver\*.class
then you signed it with:
jarsigner.exe helloserver.jar mycert
no more like
C:\>cd C:\applets\uk\me\g7wap\helloserver
C:\applets\uk\me\g7wap\helloserver>
C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jar cvf
Helloserver.jar Helloserver.class
added manifest
adding: Helloserver.class(in = 2224) (out= 1332)(deflated 40%)
C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner
Helloserver.jar dazkey
Enter Passphrase for keystore:
C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner -verify -v
erbose -certs Helloserver.jar
141 Thu Sep 22 13:16:28 BST 2005 META-INF/MANIFEST.MF
194 Thu Sep 22 13:16:30 BST 2005 META-INF/DAZKEY.SF
932 Thu Sep 22 13:16:30 BST 2005 META-INF/DAZKEY.RSA
0 Thu Sep 22 13:14:26 BST 2005 META-INF/
smk 2224 Thu Sep 22 01:28:36 BST 2005 Helloserver.class
X.509, CN=darren simpson, OU=Unknown, O=g7wap, L=mylocation,
ST=myprovince, C=uk (
dazkey)
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
jar verified.
Is your way better. Is your manifest file an executable script?