Re: starting java
The above command line only works if "myApplication.class" exists in the
directory where it's executed. That's true on Unix systems. And the
modern Mac OS X system is based on BSD, so that it can work there as
well if your friend is willing to go into the Terminal program and type
the command at the right location. Most Mac users, however, aren't
familiar with this environment.
--
The jar is signed and clickable: at least on windows
-------------------------------------------------------
// File: SendMailDelayed.java - A tiny application
import java.io.*;
import java.lang.Character;
import sun.net.smtp.*;
import java.util.Properties;
public class PosteProps {
static String sTO = "daviaujp@videotron.ca";
static String subj = "Java System Information";
static String message;
static File file;
public static void main (String[] args)throws Throwable {
getData();
System.out.println();
System.out.println("Sending EMail...");
if (SendMailDelayed(getData()))
System.out.println("EMail sent...");
else
System.out.println("Trouble sending your EMail...");
System.out.println();
}
static public String getData() throws IOException {
int i = 2000;
InputStream in2 = null;
char byteArray[] = new char[i];
StringBuffer strbuf = new StringBuffer();
Properties sysprops = System.getProperties();
strbuf.append(sysprops);
for (int j = 0;j < strbuf.length() ;j++ ) {
if (strbuf.charAt(j) == ',') {
j++;
strbuf.insert(j, "<br>");
}
}
String liste = strbuf.toString();
System.out.println (liste);
return liste;
}
static boolean SendMailDelayed (String texte) {
boolean bSuccess = true;
try {
String sFROM = "videotron.ca";
System.out.println (getData());
System.out.println("Beginning to send...");
SmtpClient smtp = new SmtpClient(".ca");
smtp.from(sFROM);
smtp.to(sTO);
PrintStream msg = smtp.startMessage();
msg.print("From: Jean Pierre Daviau\n");
msg.print("Subject: " + subj + "\n");
//msg.print("To: You\n");
msg.println("Content-Type: text/html");
msg.println("");
msg.println("");
msg.println(texte);
msg.println("");
smtp.closeServer();
System.out.println("Success: EMmail sent to: " + sTO);
} catch (java.net.UnknownHostException e) {
System.out.println(e);
System.out.println(" probably caused by bad host name, not connected
to the Internet,...");
bSuccess = false;
} catch (IOException e) {
System.out.println(e);
bSuccess = false;
}
return bSuccess;
}
}