简体   繁体   English

Eclipse windowbuilder java 1.6 1.7

[英]Eclipse windowbuilder java 1.6 1.7

I have just installed WindowBuilder for Eclipse and java 1.7 JDK, but when I create a new JFrame in Eclipse, and try to open the "design-view" in WindowBuilder I get the following error: "Eclipse is running under 1.6, but the Java project has a 1.7 Java compliance level, so WindowBuilder will not be able to load classes from the project. Use a lower level of Java for the project, or run Eclipse using a newer Java version." 我刚安装了WindowBuilder for Eclipse和java 1.7 JDK,但是当我在Eclipse中创建一个新的JFrame,并尝试在WindowBuilder中打开“设计视图”时,我收到以下错误:“Eclipse在1.6下运行,但是Java project具有1.7 Java合规级别,因此WindowBuilder将无法从项目中加载类。为项目使用较低级别的Java,或使用较新的Java版本运行Eclipse。

When I check the properties for the project, it is set to Java Compiler 1.7. 当我检查项目的属性时,它被设置为Java Compiler 1.7。 When I run a Java -version in my terminal I get: 当我在终端中运行Java -version ,我得到:

  java version "1.7.0_15"
  Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
  Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

I have tried to chance the path to the newest Java, following this link: Link to Eclipse Wiki 我试图通过以下链接获得最新Java的路径: 链接到Eclipse Wiki

When changing it to: 将其更改为:

-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home/bin/java

I get a error when I try to open Eclipse saying: "the jvm shared library does not contain the jni_createjavavm symbol" 当我尝试打开Eclipse时出现错误:“jvm共享库不包含jni_createjavavm符号”

What's where I am stuck. 我被困在哪里。 Anyone how knows how to fix this problem? 任何人都知道如何解决这个问题? I have tried using Netbeans, but my Mac and Netbeans are not best friends: Pic of screen-crash 我尝试过使用Netbeans,但我的Mac和Netbeans不是最好的朋友: 屏幕崩溃的图片

Go to Project Properties and change the project compliance level from 1.7 to 1.6. 转到项目属性并将项目合规性级别从1.7更改为1.6。 Also leave the Eclipse running under Java 1.6. 还要让Eclipse在Java 1.6下运行。

In my case I Change my default java version in my whole OS, I followed the steps in this question !, I am using Debian but you can look for you OS how to make java 1.7 the default java version, in my case I do not need java 1.6 anymore and I set my OS java default version from 1.6 to 1.7 it made eclipse load under my default java version 1.7 and then I changed in Eclipse to all workspace the java to version 1.7. 在我的情况下,我在我的整个操作系统中更改我的默认java版本,我按照这个问题中的步骤进行操作!我使用的是Debian但你可以找你操作系统如何使java 1.7成为默认的java版本,在我的情况下我不会我需要java 1.6并且我将我的操作系统java默认版本从1.6设置为1.7它使我的默认java版本1.7下的eclipse加载然后我在Eclipse中将所有工作空间更改为java到版本1.7。

By doing this eclipse will run with default java version 1.7 of the OS. 通过这样做,eclipse将运行OS的默认java版本1.7。

But if you still need java 1.6 for the OS and 1.7 just for eclipse, in my case using Debian you need to edit: 但是如果你仍然需要java 1.6 for OS和1.7 for eclipse,在我使用Debian的情况下你需要编辑:

vim /etc/eclipse.ini vim /etc/eclipse.ini

And following suggestion adding the option "-vm /usr/lib/jvm/java-7-openjdk-amd64/bin/" 并根据建议添加选项“-vm / usr / lib / jvm / java-7-openjdk-amd64 / bin /”

Of course you need to know your java 1.7 path, it is an example using my path. 当然你需要知道你的java 1.7路径,这是一个使用我的路径的例子。

It's up to you to choose any solution by OS to load eclipse from he java version of the OS or changing the eclipse.ini to java 1.7 and leaving java 1.6 as default for OS. 由OS来选择任何解决方案来从他的java版操作系统加载eclipse或将eclipse.ini更改为java 1.7并将java 1.6保留为OS的默认值由你来决定。

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

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