Results 1 to 2 of 2
Thread: cannot find symbol
- 04-06-2012, 04:31 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 18
- Rep Power
- 0
cannot find symbol
hi ,
i writing a program to let it print screen and send to others pc , below is my code :
import java.io.*;
import java.util.*;
import java.lang.*;
import java.lang.*;
import java.awt.Toolkit;
import java.util.Timer;
import java.util.TimerTask;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.Dimension;
import java.awt.Robot;
import java.io.File;
import javax.imageio.ImageIO;
public class testRSH implements Runnable
{
private StreamHandlers streamHandlers = new StreamHandlers();
public testRSH(){}
Toolkit toolkit;
Timer timer;
public void run()
{
class RemindTask extends TimerTask {
public void run() {
try {
Toolkit tool = Toolkit.getDefaultToolkit();
Dimension d = tool.getScreenSize();
Rectangle rect = new Rectangle(1024,768);
Robot robot = new Robot();
Thread.sleep(1000);
File f = new File("screenshot.jpg");
BufferedImage img = robot.createScreenCapture(rect);
ImageIO.write(img,"jpeg",f);
} catch(Exception e){}
}//close public void run
}//close class Reminder
};
public void test()
{
try
{
//Function call to capture the screen
run();
//Function call to set the RSH execution command
executionCommand = sshFileRSH("192.168.1.104", "pc2", "screenshot.jpg ", "/home/pc2/Desktop", "/home/pc3/Desktop");
//Run teh RSH command
Process p1 = Runtime.getRuntime().exec(executionCommand);
InputStreamReader isr = new InputStreamReader(p1.getInputStream());
streamHandlers.checkStreamOutput("From RuntimeExecution", isr);
}
catch(Exception e)
{
System.out.println("Error in RuntimeExecution: " + e);
}
}
//Function to set the RSH SCP command
private String sshFileRSH(String hostName, String userName, String localFileNames, String remoteDirName, String localJobDirectory)
{
String fileTransferCommand = "scp " + localFileNames;
//String fileTransferCommand = "rsync --partial --progress --rsh=ssh " + localFileNames[0] + " " + localFileNames[1] + " " + localFileNames[2];
String destinationCommand = userName + "@" + hostName + ":" + remoteDirName;
String executionCommand = "";
executionCommand = fileTransferCommand + " " + destinationCommand;
return executionCommand;
}
}
when i try to compile , i get a error as below:
testRSH.java:60: cannot find symbol
symbol : variable executionCommand
location: class testRSH
executionCommand = sshFileRSH("192.168.1.104", "pc2", "screenshot.jpg ", "/home/pc2/Desktop", "/home/pc3/Desktop");
^
testRSH.java:63: cannot find symbol
symbol : variable executionCommand
location: class testRSH
Process p1 = Runtime.getRuntime().exec(executionCommand);
^
2 errors
can anyone tell me what is the problem ? i have google it a lot but i still dun understand why cannot find symbol .
thanks in advance for the reply ..
- 04-06-2012, 05:00 AM #2
Similar Threads
-
Cannot Find Symbol
By Promisha in forum New To JavaReplies: 10Last Post: 03-30-2011, 02:11 AM -
Cannot find symbol
By Johanis in forum New To JavaReplies: 19Last Post: 11-04-2010, 08:13 PM -
Still cannot find symbol!
By Johanis in forum New To JavaReplies: 1Last Post: 11-04-2010, 04:32 PM -
cannot find symbol symbol :constructor Error. Please help! =(
By KalEl in forum New To JavaReplies: 9Last Post: 10-18-2008, 08:26 PM -
cannot find symbol symbol : class Item location: package platypos.services.order
By officialhopsof in forum New To JavaReplies: 3Last Post: 05-01-2008, 08:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks