我正在使用一个.html文件生成器,该生成器可用于在浏览器中查看.swf文件,但是出现“未解决的编译问题”错误。我的进口商品可能有问题吗?
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class CreateFile {
public static String starthtml = "<object><embed src=\"";
public static String endhtml = ".swf\" width=\"100%\" height=\"100%\"></embed></object>";
public static String s;
public static void main(String[] args) {
try {
File myobj = new File("flash Loader.html");
if (myobj.createNewFile()) {
System.out.println("flash Loader Created Successfully");
} else {
System.out.println("File already exists");
}
} catch (IOException e) {
System.out.println("An error occurred");
e.printStackTrace();
}
Scanner sc = new Scanner(System.in);
System.out.println("Enter SWF file name");
s = sc.nextLine();
try {
FileWriter myWriter = new FileWriter("flash Loader.html");
myWriter.write(starthtml+sc+endhtml);
myWriter.close();
System.out.println("Successfully wrote to the file");
} catch (IOException e) {
System.out.println("An error occurred");
e.printStackTrace();
}
}
}
错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at CreateFile.main(flash_Loader_Creator.java:10)