Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

java - 无法启动Eclipse-Java已启动,但返回了退出代码= 13(Can't start Eclipse - Java was started but returned exit code=13)

I am trying to get my first taste of Android development using Eclipse.

(我正在尝试使用Eclipse进行Android开发。)

I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.

(在几分钟前尝试安装Eclipse时,我尝试运行Eclipse时遇到了这个问题。)

After first trying to start Eclipse without any parameters to specify the Java VM, I got an error message saying it couldn't find a Java VM called javaw.exe inside the Eclipse folder , so I found where Java was installed and specified that location as the parameter in the shortcut's target.

(第一次尝试在没有任何参数的情况下启动Eclipse以指定Java VM之后,我收到一条错误消息,提示它couldn't find a Java VM called javaw.exe inside the Eclipse folder ,因此我找到了Java的安装位置,并将该位置指定为快捷方式目标中的参数。)

Now I get a different error, Java was started but returned exit code=13 .

(现在,我得到另一个错误, Java was started but returned exit code=13 。)

Similar questions seem to indicate that it's a 32-bit/64-bit conflict, but I'm 99% positive that I downloaded 64-bit versions of both Eclipse and Java (RE 7u5) , which I chose because I have 64-bit Windows 7.

(类似的问题似乎表明这是32位/ 64位冲突,但我对我下载Eclipse和Java (RE 7u5) 64位版本表示Java (RE 7u5) ,因为我拥有64位版本,我对此表示肯定。 Windows 7的。)

  • If anyone knows how to confirm that my Eclipse and Java are 64-bit, that'd be appreciated.

    (如果有人知道如何确认我的Eclipse和Java是64位的,将不胜感激。)

  • If you think my problem is a different one, please help!

    (如果您认为我的问题不同,请提供帮助!)

  • Please speak as plainly as you can, as I am totally new to Eclipse and Java.

    (请尽我所能,因为我是Eclipse和Java的新手。)

Shortcut Target: "C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\eclipse.exe" -vm "C:\Program Files (x86)\Java\jre7\bin\javaw.exe"

(快捷方式目标:“ C:\ Program Files \ Eclipse-SDK-4.2-win32-x86_64 \ eclipse \ eclipse.exe” -vm“ C:\ Program Files(x86)\ Java \ jre7 \ bin \ javaw.exe”)

Full error code...:

(完整的错误代码...:)

Java was started but returned exit code=13
C:Program Files (x86)Javajre7injavaw.exe
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipse\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
-os win32
-ws win32
-arch x86_64
-showsplash C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipse\pluginsorg.eclipse.platform_4.2.0.v201206081400splash.bmp
-launcher C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipseeclipse.exe
-name Eclipse
--launcher.library C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v201205221813eclipse_1503.dll
-startup C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipse\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 1e30_5c
-vm C:Program Files (x86)Javajre7injavaw.exe
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:Program FilesEclipse-SDK-4.2-win32-x86_64eclipse\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
  ask by Ben E. translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your version of Eclipse is 64-bit, based on the paths and filenames.

(您的Eclipse版本是64位,基于路径和文件名。)

However, the version of Java that it's picking up is 32-bit, as indicated by where it is coming from, on this line:

(但是,它所提取的Java版本是32位,如其来源所示,在此行上:)

-vm C:Program Files (x86)Javajre7injavaw.exe

Program Files (x86) is the folder where 64-bit Windows places 32-bit programs.

(Program Files (x86)是64位Windows放置32位程序的文件夹。)

Program Files is the folder where 64-bit Windows places 64-bit programs.

(Program Files是64位Windows放置64位程序的文件夹。)

This can happen when a system has more than one JVM installed, as is often the case on Windows 64-bit (for example, the JRE download page uses the bit-ness of the browser to determine what bit-ness download to offer you, and many people use(d) 32-bit browsers even though they run 64-bit Windows).

(当系统安装了多个JVM时(例如Windows 64位),这种情况就会发生(例如,JRE下载页面使用浏览器的位来确定为您提供哪种位下载,并且许多人使用(d)32位浏览器,即使它们运行的??是64位Windows)。)

The best way to fix this, assuming you do in fact have 64-bit JRE or JDK on your system, is to specify in eclipse.ini exactly which JVM you want it to use.

(假设您实际上在系统上确实有64位JRE或JDK,则解决此问题的最佳方法是在eclipse.ini准确指定要使用的JVM。)

The instructions are detailed in the Eclipse wiki page , but basically you have to specify the -vm option in the ini file - make sure to read the wiki page carefully as the format is very specific.

(Eclipse Wiki页面上有详细的说明,但是基本上,您必须在ini文件中指定-vm选项-请确保仔细阅读Wiki页面,因为格式非常具体。)

Specifying the JVM path in eclipse.ini is strongly recommended because doing so isolates Eclipse from any potential changes to your system PATH that some program installers might make (I'm talking to you, Oracle!).

(强烈建议在eclipse.ini指定JVM路径,因为这样做可以将Eclipse与某些程序安装程序可能对您的系统PATH所做的任何潜在更改隔离开来(我正在与您交谈,Oracle!)。)

Another option would be to download and use 32-bit Eclipse instead of 64-bit, but it's still strongly recommended to specify the path to the JVM in eclipse.ini .

(另一种选择是下载并使用32位Eclipse而不是64位,但是仍然强烈建议在eclipse.ini指定JVM的路径。)


Left for historical reference :

(留作历史参考 :)

To check your version of Java, run

(要检查您的Java版本,请运行)

java -version

in a console (command prompt).

(在控制台中(命令提示符)。)

On Windows 7 with 64-bit Java 6 I get:

(在具有64位Java 6的Windows 7上,我得到:)

java version "1.6.0_27"
  Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
  Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

Note the 3rd line, which shows that this is a 64-bit version.

(请注意第三行,它显示这是一个64位版本。)

On a 32-bit version you'll get something like:

(在32位版本上,您将获得以下内容:)

Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...