Reputation: 33
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."
When I check the properties for the project, it is set to Java Compiler 1.7. When I run a Java -version
in my terminal I get:
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
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"
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
Upvotes: 3
Views: 9565
Reputation: 1
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.
By doing this eclipse will run with default java version 1.7 of the OS.
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:
vim /etc/eclipse.ini
And following suggestion adding the option "-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.
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.
Upvotes: -1
Reputation: 3687
Go to Project Properties and change the project compliance level from 1.7 to 1.6. Also leave the Eclipse running under Java 1.6.
Upvotes: 6