title: Convert absolute path to relative path for photo in Java
body: <p>I try to give a relative path to the popup.jpg file but all the time it crashes that it does not find the file and the internet did not give me an answer so I decided to ask here</p>
  <p>It's my code:</p>
  <pre><code>public class WrongDate
  {
      public static void main(String[] args) throws MalformedURLException, InterruptedException, FindFailed
        {
       
   //String page = &quot;C:\\Users\\kamil\\OneDrive\\Dokumenty\\eclipse - proj\\Project\\popup.jpg&quot;; 
         
   String page = &quot;./eclipse - proj/Project/popup.jpg&quot;;  
          WebDriver driver = new ChromeDriver();
          
          driver.navigate().to(&quot;https://www.fandom.com/register?redirect=https%3A%2F%2Fwww.fandom.com%2Fexplore-pl%3Fuselang%3Dpl%26cb%3D1618719439872&quot;);
          driver.findElement(By.xpath(&quot;/html/body/div[1]/div/div/div[2]/div[2]&quot;)).click();
          driver.findElement(By.id(&quot;signupEmail&quot;)).sendKeys(&quot;&quot;);
          driver.findElement(By.id(&quot;signupUsername&quot;)).sendKeys(&quot;&quot;);
          driver.findElement(By.id(&quot;signupPassword&quot;)).sendKeys(&quot;&quot;);
          driver.findElement(By.name(&quot;birthdate&quot;)).click();
          driver.findElement(By.name(&quot;month&quot;)).sendKeys(&quot;89&quot;);
          driver.findElement(By.name(&quot;day&quot;)).sendKeys(&quot;48&quot;);
          driver.findElement(By.name(&quot;year&quot;)).sendKeys(&quot;1567&quot;);
          driver.findElement(By.id(&quot;signupSubmit&quot;)).click();    
          Screen a = new Screen();
          a.find(page);
          //String b = driver.findElement(By.xpath(&quot;//*[@id=\&quot;signupForm\&quot;]/div[3]/small&quot;)).getText();
  
          System.out.println(page);
        }
  };
  </code></pre>