转载自:https://blog.csdn.net/gnail_oug/article/details/51925804;个人做了些小修改。

今天下载了eclipse4.6版本,打开时报Version 1.7.0_45 of the JVM is not suitable for this product. Version:1.8 or greater is required.,提示jdk版本要1.8以上,如下图:

由于不想直接将环境变量配置的jdk1.7改为jdk1.8,所以单独在eclipse的配置文件里指定jdk来运行eclipse4.6,方法如下:

打开eclipse根目录下的eclipse.ini配置文件,eclipse4.6默认配置如下:

  1. -startup
  2. plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
  3. --launcher.library
  4. plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444
  5. -product
  6. org.eclipse.epp.package.jee.product
  7. --launcher.defaultAction
  8. openFile
  9. -showsplash
  10. org.eclipse.platform
  11. --launcher.defaultAction
  12. openFile
  13. --launcher.appendVmargs
  14. -vmargs
  15. -Dosgi.requiredJavaVersion=1.8
  16. -XX:+UseG1GC
  17. -XX:+UseStringDeduplication
  18. -Dosgi.requiredJavaVersion=1.8
  19. -Xms256m
  20. -Xmx1024m

在 -vmargs 上一行--launcher.appendVmargs的上一行增加 -vm参数来指定jdk路径,如我的jdk路径在d:\java文件夹下 :

-vm
D:\java\jdk1.8.0_91\bin\javaw.exe

添加 -vm参数后的配置文件如下:

  1. -startup
  2. plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
  3. --launcher.library
  4. plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444
  5. -product
  6. org.eclipse.epp.package.jee.product
  7. --launcher.defaultAction
  8. openFile
  9. -showsplash
  10. org.eclipse.platform
  11. --launcher.defaultAction
  12. openFile
  13. -vm
  14. D:\java\jdk1.8.0_91\bin\javaw.exe
  15. --launcher.appendVmargs
  16. -vmargs
  17. -Dosgi.requiredJavaVersion=1.8
  18. -XX:+UseG1GC
  19. -XX:+UseStringDeduplication
  20. -Dosgi.requiredJavaVersion=1.8
  21. -Xms256m
  22. -Xmx1024m

然后再次运行eclipse.exe便能正常启动了。

如何在eclipse的配置文件里指定jdk路径的更多相关文章

  1. (转)如何在eclipse的配置文件里指定jdk路径

    本文转载自:http://songguoliang.iteye.com/blog/1752519 运行eclipse时报如下错误: 在eclipse的配置文件里指定jdk路径,只需在eclipse的配 ...

  2. 在eclipse的配置文件里指定jdk路径

    在eclipse的配置文件里指定jdk路径,只需在eclipse的配置文件里增加-vm参数即可. 打开eclipse目录下的eclipse.ini配置文件,增加-vm配置,需要注意的是该参数要加在-v ...

  3. Tomcat指定JDK路径(Linux+Windows)

    当系统有多套JDK,不方便在系统配统一的JAVA_HOME时,我们可能想给tomcat指定JDK路径. 1.Linux下Tomcat指定JDK路径 找到$CATALINE_HOME/bin/catal ...

  4. eclipse debug configurations arguments指定文件路径参数

    1 eclipse debug configurations arguments指定文件路径参数 使用绝对路径,但是这个文件必须要放在该project的源码路径的外面才行,否则eclipse不认这个文 ...

  5. Tomcat指定JDK路径

    一.应用实例 一般情况下一台服务器只跑一个业务,那么就直接配置一套环境,设置好Java环境变量即可.某些时候一台服务器上会安装多个业务,而且各个业务需要的JDK版本各不相同,或者为了使业务独立开来,需 ...

  6. [#Linux] CentOS 7 配置JDK后,eclipse无法启动,提示jdk路径错误。

    ​​​​ 解决方案:在eclipse的目录下创建一个jre文件夹,在jre文件夹里创建一个jdk的bin目录的链接 1.进入到eclipse目录下,右键在终端打开. 2.创建jre目录:mkdir j ...

  7. eclipse指定jdk路径

  8. Tomcat手动指定jdk路径

    Windows系统: 修改bin下的setclasspath.bat,在开头处添加: rem set specific jdkset JAVA_HOME=%CATALINA_HOME%\jdk1.8. ...

  9. 怎样在Mac OS X上面指定Eclipse启动时用指定的某一版本号JDK?

    编辑 $ECLIPSE_HOME/Eclipse.app/Contents/MacOS/eclipse.ini 文件.在 Finder 中右键或者Ctrl+点击 Eclipse 应用程序.然后点击&q ...

随机推荐

  1. ios 获得webview user-agent

    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectZero]; NSString *myUserAgent = [webView s ...

  2. tensorflow ValueError: Cannot feed value of shape (5000,) for Tensor 'output:0', which has shape '(?, 10)'

    提供的训练数据和定义的模型之间的维度不对应. 在MNIST手写数字识别时,在 mnist = input_data.read_data_sets("MNIST_data/") 中, ...

  3. Status Code:405 Method Not Allowed

    场景: 前端调用方法的时候,调不通,并且报错信息为405 因为我们公司前后端分离开发,于是前端就来找我说我写的接口有问题?于是我就在这里的postman中测试发现没问题啊. 然后我好好看了一下报错信息 ...

  4. OpenCv 人脸识别 基础

    #include <opencv2\opencv.hpp> #include <iostream> using namespace std; int main() { // 摄 ...

  5. 02 Tensorflow的安装配置

    1 anaconda 64 位,win10 安装 清华大学镜像网络,下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 选择下载文件 ...

  6. Validate the date format

    Validate the date format function checkdate(input) { var validformat = /^\d{2}\/\d{2}\/\d{4}$/; //Ba ...

  7. linux添加root级别账户

    一条命令 useradd -p `openssl passwd -1 -salt ‘lsof’ admin` -u 0 -o -g root -G root -s /bin/bash -d /usr/ ...

  8. innerText 与textContent区别

    两者都是可以过滤html元素 innerText 获取内容 换行会有L类似特殊符号 textContent 没有

  9. Mysql Innodb 性能参数设置 https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html

    参考原文: https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html 查看系统 ...

  10. [leetcode]174. Dungeon Game地牢游戏

    The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. ...