zoukankan      html  css  js  c++  java
  • 让Eclipse使用新版本的JRE

    更新到新的 Mac OS X 再打开Eclipse 编译程序会报错,

    Exception in thread "main" java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0

    原因是Eclipse 找不到新版本的Java Runtime 的路径,需要有人来告诉他,解决办法:

    1. Launch Eclipse.app
    2. Choose Eclipse -> Preferences
    3. Choose Java -> Installed JREs
    4. Click the Add... button
    5. Choose MacOS X VM as the JRE type. Press Next.
    6. In the "JRE Home:" field, type /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
    7. You should see the system libraries in the list titled "JRE system libraries:"
    8. Give the JRE a name. The recommended name is JDK 1.7. Click Finish.
    9. Check the checkbox next to the JRE entry you just created. This will cause Eclipse to use it as the default JRE for all new Java projects. Click OK.
    10. Now, create a new project. For this verification, from the menu, select File -> New -> Java Project.
    11. In the dialog that appears, enter a new name for your project. For this verification, type Test17Project
    12. In the JRE section of the dialog, select Use default JRE (currently JDK 1.7)
    13. Click Finish.
  • 相关阅读:
    Kafka学习笔记(五、Kafka偏移量)
    web-备份是个好习惯
    web-Web5
    web-web4
    web-flag就在index里
    C++日期类、时间类、日期时间类的设计
    蒙提霍尔问题简单粗暴的理解掉
    sql分组操作符与聚集函数
    sql增删改
    sql简单查询
  • 原文地址:https://www.cnblogs.com/Antech/p/3771654.html
Copyright © 2011-2022 走看看