这种编译方法对吗?如何将它做成可执行文件呢?
import com.sensestream.app.myalbum.util.FormUploader;
import com.sensestream.media.MIMEType;
import java.io.*;
public class Submit3PIExample {
static String targetURL = "http://www.test.com/doSend.jsp";
static String senderID = "13910008585";
//static String recipientID = "13900000379";
static String recipientID;
static String subject = "3PI Test";
//static String targetType = "nokia7650";
static String targetType;
static String smilName = "mms.smil";
static String gifName = "Beach.gif";
static byte[] smil = null;
static byte[] gif = null;
public static void main(String args[]) {
String tmp;
recipientID=args[0];
tmp=args[1];
if(tmp=="1")
{
targetType= "nokia7650";
}
if(tmp=="2")
{
targetType= "ericssont68i";
}
if(tmp=="3")
{
targetType= "nokia6610";
}
if(tmp=="4")
{
targetType= "panasonicgd88";
}
smil = readfile(smilName);
gif = readfile(gifName);
doUpload();
}
public static void doUpload() {
try {
FormUploader uploader = new FormUploader();
uploader.addFormParameter("senderID", senderID);
uploader.addFormParameter("recipientID", recipientID);
uploader.addFormParameter("subject", subject);
uploader.addFormParameter("targetType", targetType);
uploader.addBinaryContent(smil, "application/smil", smilName, "filename");
uploader.addBinaryContent(gif, "image/gif", gifName, "filename");
uploader.upload(targetURL);
}
catch (Exception e) {
e.printStackTrace();
}
}
public static byte[] readfile(String filename) {
byte[] byteArray = null;
try {
FileInputStream f = null;
f = new FileInputStream(filename);
int len = f.available();
byteArray = new byte[len];
f.read(byteArray);
f.close();
}
catch (Exception e) {
e.printStackTrace();
}
return(byteArray);
}
}
javac -classpath MIMEupload.jar Submit3PIExample.java
java -classpath .;./MIMEupload.jar Submit3PIExample 13910337379 1
main(String args[])中的参数传递对吗?如果不对应该怎么传?