简体   繁体   English

STS 启动错误 - Java 已启动但返回退出代码=13

[英]STS launch error - Java was started but returned exit code=13

So I installed STS a while back now onto my Windows 7 64-bit machine, every time I try run STS I get the attached Java exit code=13 error below.所以我将 STS 安装到我的 Windows 7 64 位机器上,每次我尝试运行 STS 时,我都会收到以下附加的 Java 退出代码 = 13 错误。

I don't have have Eclipse installed into my machine, I mention this because every time I have tried to Google this error code threads about the same issue happening on Eclipse come up.我没有在我的机器上安装 Eclipse,我提到这一点是因为每次我试图谷歌时,这个错误代码线程都会出现在 Eclipse 上发生的相同问题。

I have also tried checking if Java is installed on my machine which it is.我也试过检查我的机器上是否安装了 Java。

Does anyone know how to resolve this?有谁知道如何解决这个问题?

First you need to check that you are using 64 bit java.首先,您需要检查您使用的是64 bit java。 Next you need to point to that version of java in your STS.ini file.接下来,您需要在STS.ini文件中指向该版本的 java。

You can do this by specifying the -vm option in the STS.ini file.您可以通过在STS.ini文件中指定-vm选项来完成此操作。 The -vm option must be placed after the other Eclipse-specific options (such as -product, --launcher.*, etc), but before the -vmargs option. -vm选项必须放在其他特定于 Eclipse 的选项(例如 -product、--launcher.* 等)之后,但在 -vmargs 选项之前。

-vm argument might look like: -vm参数可能如下所示:

-vm
C:\jdk1.7.0_21\bin\javaw.exe

or或者

-vm C:\jdk1.7.0_21\bin\javaw.exe 

or或者

-vm C:\jdk1.7.0_21\jre\bin\java.exe

If you encounter Java was started but returned exit code=1 point the `-vm option to jvm.dll如果您遇到Java was started but returned exit code=1将 `-vm 选项指向 jvm.dll

-vm
C:\Development\Java\64bit\jdk1.7.0_09\jre\bin\server\jvm.dll

Here is how I added it in my STS.ini file.这是我在STS.ini文件中添加它的STS.ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vm
C:\Program Files\IBM\Java71\jre\bin\java.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-XX:MaxPermSize=256m
-Xverify:none
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx1200m

References:参考:

  1. Eclipse Wiki page Eclipse 维基页面

  2. Stack overflow answer by DNA to similar question DNA对类似问题的堆栈溢出答案

检查您的操作系统架构是否使用了正确的 Java 版本,32 位或 64 位

STS mostly ends up with error code 13 if you are using for the first time.如果您是第一次使用,STS 通常会以错误代码 13 结束。 Here is a fix to the problem.这是解决问题的方法。 Please visit this link I found here https://youtu.be/cMClVM6rzuc .请访问我在此处找到的链接https://youtu.be/cMClVM6rzuc

here is the summary of the solution - The Error while launching STS is mostly because you have downloaded 32 bit STS bundle from spring.io website.这是解决方案的摘要 - 启动 STS 时出错主要是因为您从 spring.io 网站下载了 32 位 STS 包。 you need to check your system architecture and download the appropriate version.您需要检查您的系统架构并下载适当的版本。 You can watch the video for detailed information.您可以观看视频了解详细信息。 I am 100% sure you will find your solution我 100% 相信你会找到你的解决方案

If you dowloaded 64 bits version of STS Spring, check the version of java you have by taping in cmd :如果您下载了 64 位版本的 STS Spring,请通过输入 cmd 来检查您拥有的 java 版本:

java -d64 -version 

If you dont have the jre 64 bits, install it and it will work .如果你没有 jre 64 位,安装它,它会工作。

I faced this issue due to my java update.由于我的 Java 更新,我遇到了这个问题。 So below is the cause所以下面是原因

  1. Or java 64 bit and eclipse 32 bit version或者java 64位和eclipse 32位版本
  2. You have java version 32 bit and eclipse 64 bit version你有 java 32 位版本和 eclipse 64 位版本
  3. External cause, if you have two version of java installed(32 bit and 64 bit), if one got updated means your path variable pointing to java will change.外部原因,如果您安装了两个版本的 java(32 位和 64 位),如果一个版本更新意味着您指向 java 的路径变量将发生变化。

Solution:- Check your java version is 32 bit or 64 bit with command below解决方案:- 使用以下命令检查您的 Java 版本是 32 位还是 64 位

 java -d64 -version

If It's 64 bit it will show如果是 64 位,它将显示

java version "1.8.0_181"

Java(TM) SE Runtime Environment (build 1.8.0_181-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

If It's not如果不是

It will show something like this它会显示这样的东西

Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.

Based on the java version change your STS, to either 32 bit or 64 bit.根据 java 版本将您的 STS 更改为 32 位或 64 位。

I removed C:\\ProgramData\\Oracle\\Java\\javapath from the PATH environment variable.我从PATH环境变量中删除了C:\\ProgramData\\Oracle\\Java\\javapath It worked for me then.当时它对我有用。 So basically it's a path variable issue.所以基本上这是一个路径变量问题。

please make sure you download the 64bit version from https://spring.io/tools/sts/all .请确保您从https://spring.io/tools/sts/all下载 64 位版本。

确保从 https://spring.io/tools/sts/all 下载 64 位版本

On the STS page, the Download STS button downloads the version for 32-bit Windows by default.在 STS 页面上,下载 STS按钮默认下载适用于 32 位 Windows 的版本。 Under the download button, click See all versions ( https://spring.io/tools/sts/all ).在下载按钮下,单击查看所有版本( https://spring.io/tools/sts/all )。 From there you can click the menu button and select the 64-bit Windows version.从那里您可以单击菜单按钮并选择 64 位 Windows 版本。

如上所述,只需安装 32 位 JRE(如果您已经安装了 64 位)并将 -vm 指向这个 32 位 JRE。

So basically when you go to Spring website, it doesnt understand your client OS and prompts you to download 32 bit version.所以基本上当你去 Spring 网站时,它不了解你的客户端操作系统并提示你下载 32 位版本。 I faced the same issue and explicitly had to download 64 bit version, by clicking on "see all versions".我遇到了同样的问题,必须通过单击“查看所有版本”明确下载 64 位版本。 Also some suggested removing "C:\\ProgramData\\Oracle\\Java\\javapath" entry from Path, but while it is true if you have actually downloaded JDK 1.8, it is not going to help resolve the specific issue here.还有一些人建议从 Path 中删除“C:\\ProgramData\\Oracle\\Java\\javapath”条目,但是如果您实际下载了 JDK 1.8,这是正确的,但它不会帮助解决此处的特定问题。

Open "SpringToolSuite4.ini" or sts.ini and make sure you have javaw.exe path in .ini file.打开“SpringToolSuite4.ini”或 sts.ini 并确保您在 .ini 文件中有 javaw.exe 路径。

-vm

D:\Projects\Softwares\JDK\bin\javaw.exe

File should look similar as below.文件应如下所示。

-startup

plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1000.v20190125-2016

-product

org.springframework.boot.ide.branding.sts4

--launcher.defaultAction

openFile

-vm

D:\Projects\Softwares\JDK\bin\javaw.exe

-vmargs

-Dosgi.requiredJavaVersion=1.8

-Xms256m

-Xmx1024m

-XX:+UseG1GC

-XX:+UseStringDeduplication

--add-modules=ALL-SYSTEM

You likely installed the default version of STS from the spring.io website which is normally the 32 bit version.您可能从 spring.io 网站安装了默认版本的 STS,通常是 32 位版本。

Click to see all versions and download the windows 64 bit version from the next page.单击以查看所有版本并从下一页下载 Windows 64 位版本。

Good luck.祝你好运。

By Removing following java path from environment variables path is fixed the issue.通过从环境变量路径中删除以下 java 路径可以解决问题。

C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath

Have another jdk in path.在路径中有另一个 jdk。

Initial I uninstall another Java SE Development Kit , next I added the follow path in the *SpringToolSuite4.ini in my case: *(depends of your IDE that you´ve installed)最初我卸载了另一个 Java SE 开发工具包,接下来我在 *SpringToolSuite4.ini 中添加了以下路径:*(取决于您安装的 IDE)

-vm
C:\Program Files\Java\jdk1.8.0_131\bin\java.exe**

您只需要重新安装JDK (相同或最新版本)和STS (并非总是需要)。

First of all, please check your STS path.首先,请检查您的 STS 路径。 Remove if there is any special character such as # or etc in your path.如果您的路径中有任何特殊字符(例如#或 etc),请删除。 After verify this, please go for any of the above solutions ;)验证这一点后,请选择上述任何解决方案;)

The first step is like the is already related above: open the document parameters of configuration "STS" and send the commands below to "openFile":第一步就像上面已经相关的:打开配置“STS”的文档参数并将以下命令发送到“openFile”:

-vm
C:\Program Files\Java\jdk-11.0.2\bin\javaw.exe

To check the version of JDK, on your prompt do the command:要检查 JDK 的版本,请在您的提示下执行以下命令:

java -version

You will find in "build".您会在“构建”中找到。

If you still having the problem with JDK path not finded, the path to found your JDK on pc is:如果您仍然遇到找不到JDK路径的问题,那么在PC上找到您的JDK的路径是:


my computer -> archives and programs -> java -> jdk -> bin -> javaw我的电脑 -> 档案和程序 -> java -> jdk -> bin -> javaw

when you reach at this, click and inspect the properties of and copy the route to put on command after -vm.当你到达这里时,单击并检查属性并将路由复制到 -vm 之后放置命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM