KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My project includes htmlunit jars and downloads some pages content. Executable jar (which includes libs, funct. of eclipse export) thereof, however, works only on the machine on which I created it (on different it doesn't execute). EDIT: It doesn't execute as it doesn't show "Starting Headless Browser" MessageBox upon startup. I used Eclipse Indigo: File > Export > Runnable jar > package required libratries into generated jar Help, gods: import java.io.*; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.RefreshHandler; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlTextInput; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.*; import javax.swing.filechooser.FileSystemView; EDIT: further code, as requested public class MyTest { public static void main(String[] arguments) { try{ JOptionPane.showMessageDialog(null, "Starting Headless Browser"); JFileChooser fr = new JFileChooser(); FileSystemView fw = fr.getFileSystemView(); String MyDocuments = fw.getDefaultDirectory().toString(); FileInputStream fstream = new FileInputStream(MyDocuments+"\\Links.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; String strLineID; FileWriter xfstream = new FileWriter(MyDocuments+"\\NewPageContentList.txt"); BufferedWriter out = new BufferedWriter(xfstream); while ((strLineID = br.readLine()) != null) { strLine = br.readLine(); out.write(strLineID); out.write("\r\n"); out.write(DownloadPage(strLine)); out.write("\r\n"); } out.close(); in.close(); JOptionPane.showMessageDialog(null, "HeadLess Browser Process Has Finished"); } catch (Exception e){ JOptionPane.showMessageDialog(null, "error"); } } public static S
Tags (comma-separated)
Save Edits
Cancel