title: Firefox in ubuntu cli GLib-CRITICAL error
body: <p>I have installed Firefox on my ubuntu server so I can run selenium testing through jenkins linked to bitbucket. </p>
  
  <p>Jenkins told me that it didnt have access to firefox so I installed it with </p>
  
  <pre><code>sudo apt-get install firefox
  </code></pre>
  
  <p>this installed firefox version 38. the tests continued to give errors like this</p>
  
  <pre><code>org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host    
  127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
  
  (process:28482): GLib-CRITICAL **: g_slice_set_config: assertion 
  'sys_page_size == 0' failed
  
  Error: no display specified
  
  (process:28489): GLib-CRITICAL **: g_slice_set_config: assertion 
  'sys_page_size == 0' failed
  
  Error: no display specified
  </code></pre>
  
  <p>when I check the version this error comes up to. I have fully removed firefox and installed from the tar file to version 35 since I read that this could fix the problem.</p>
  
  <p>It didn't fix it, the error comes back the exact same but the version has been changed to 35.</p>
  
  <p>This is the Main of script that Jenkins is running</p>
  
  <pre><code>public class Test {
  protected WebDriver driver;
  
  @Before  
  public void setUp(){        
  driver = new FirefoxDriver(); 
  driver.get("http://www.google.com");
  
  } //End Before
  
  @Test
  
  public void testGoogleSearch() { 
  
     // Find the text input element by its name          
  WebElement element =  driver.findElement(By.name("q"));
     // Enter something to search for          
  element.sendKeys("Selenium testing tools cookbook");
     // Now submit the form. WebDriver will find             
  //the form for us from the element            
  element.submit();
  
  System.out.println("You have just logged into the  google6 website");
  
  } //End of google search
  
  @After   
  public void tearDown() throws Exception {       
  //Close the browser
  
  driver.quit();
  }
  }//end
  </code></pre>
  
  <p>I don't believe the script is the problem but I thought that I would try to build a full picture.</p>
  
  <p>Any help fixing this firefox error is really appreciated. Thanks</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>I am using Maven and the version of selenium is 2.45.0</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I am running firefox headlessly</p>