簡體   English   中英

Java 虛擬機啟動器 Eclipse

[英]Java Virtual Machine Launcher Eclipse

關於這個問題,我在Stackoverflow上閱讀了很多線程,並在 google 上嘗試了很多解決方案。 並且每次我還清理了 %appdata% 的 java 和 eclipse + 清理過的 regedit 的舊內容。
還測試了所有幾種解決方案,但沒有對我有用。

我目前正在測試以使其與:

  • 窗口 10 64 位
  • eclipse-standard-luna-R-win32-x86_64
  • jre-7u65-windows-x64

這是我的項目代碼:

 package tets; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.Test; public class Testcase { String driverPath = "C:\\\\Users\\\\abc\\\\Desktop\\\\Server\\\\geckodriver.exe"; public WebDriver driver; @Test public void LaunchBrowser(){ System.out.println("Launching Mozilla Firefox Browser"); System.setProperty("webdriver.gecko.driver", driverPath+"geckodriver.exe"); driver =new FirefoxDriver(); } @Test public void openApplication(){ driver.navigate().to("http://www.google.se"); } }

這是我的圖書館的樣子:

在此處輸入圖片說明

這是我的環境變量: 在此處輸入圖片說明

請注意,我還測試了為我的用戶放置一個變量,但沒有結果:
這是我的 **Eclipse.ini文件的樣子:**

 -startup -vm C:\\Program Files\\Java\\jre7\\bin plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326 -product org.eclipse.epp.package.standard.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.7 -Xms40m -Xmx512m

這是我按下運行按鈕時的錯誤:

在此處輸入圖片說明

在此處輸入圖片說明

如果您需要更多信息,請告訴我。

我還測試了從以下位置下載和安裝 Java devkit:

我還測試了下載最新版本的 eclipse 和 Java,它們都是 x86 + 64 位相互關聯的。

有人可以幫助我嗎?

先感謝您

此致

丹尼爾

我遇到了同樣的問題,我通過以下步驟解決了:

  1. 我關閉了日食
  2. 我從我的工作區中刪除了.metadata文件夾
  3. 我打開了 eclipse,再試一次,它奏效了

查看您的代碼后,我發現您將geckodriver.exe作為geckodriver.exe一部分。 當您設置屬性時,您將添加一個額外的geckodriver.exe

我建議從您的 driverPath 中刪除“geckodriver.exe”並嘗試。

driverPath = C:\\Users\\abc\\Desktop\\Server;
System.setProperty("webdriver.gecko.driver", driverPath+"geckodriver.exe");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM