The build path indicates the J2SE-1.5 runtime. There are no JREs in the workspace that are strictly compatible with this environment.

I am using OS X Yosemite (10.10.2) and have several java projects that I want to build in Eclipse. Some projects are old and they are in Java 5, 6 and 7. First I installed JDK 7 and Eclipse Luna. Then I read this and this thread how to install a specific JDK on Mac. I used this script to install the JDK and changed these two lines for compatibility with Yosemite.

/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumFrameworkVersion 14.*.*" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumSystemVersion "$osx_version".*" ./Resources/Info.plist

by

/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumFrameworkVersion" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumSystemVersion" ./Resources/Info.plist

Here is the contents of my directory /System/Library/Frameworks/JavaVM.framework/Versions

lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.5 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.5.0 -> CurrentJDK
drwxr-xr-x  9 root  wheel  306  8 apr 14:32 1.5.0_30
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.6 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.6.0 -> CurrentJDK
drwxr-xr-x  7 root  wheel  238  8 apr 14:36 A
lrwxr-xr-x  1 root  wheel    1  8 apr 14:36 Current -> A
lrwxr-xr-x  1 root  wheel   59  8 apr 14:36 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

JDK 7 location is different and way /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk

The default version for Java is:

AND:bin andr-work$ java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

Install JDK here in Eclipse settings

enter image description here

Version 7

enter image description here

Version 6

enter image description here

Version 5

enter image description here

java 6 7, java- Eclipse

enter image description here

enter image description here

java 5 , , java 5

enter image description here

... "A" Mac

, Java .

Eclipse

enter image description here

.

Java J2SE-1.5, JRE >

enter image description here

J2SE-1.5, (J2SE-1.5)

java source target build.xml

    <?xml version="1.0"?>
<project name="build" default="jar">
    <description>
            A build script
    </description>

    <property name="ant.build.javac.source" value="1.5"/>
    <property name="ant.build.javac.target" value="1.5"/>

    <property name="dist.jar" value="ci-ons.jar"></property>
    <property name="dist.folder" value="dist"></property>
    <property name="src.folder" value="src"/>
    <property name="classes.folder" value="bin"/>

</project>

.

, java 5 Eclipse Yosemite?

EDIT:// JDK 1.5, CurrentJDK, JDK 1.6. JDK 1.5 1.6, JDK 1.5 JDK 1.5

lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  9 apr 11:01 1.5 -> ./1.5.0_30
lrwxr-xr-x  1 root  wheel   10  9 apr 11:01 1.5.0 -> ./1.5.0_30
drwxr-xr-x  9 root  wheel  306  9 apr 11:01 1.5.0_30
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.6 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10  8 apr 14:36 1.6.0 -> CurrentJDK
drwxr-xr-x  7 root  wheel  238  8 apr 14:36 A
lrwxr-xr-x  1 root  wheel    1  8 apr 14:36 Current -> A

, , , JDK 1.5 JRE 1.5, Eclipse Java- > Installed JREs- > Execution Environments, JRE 1.5

enter image description here

Java 5, :

Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0_30

enter image description here

0
2

, " Java" Project Explorer "". " " Java.

+1

eclipse: java

Dyadee Windows 10.

, java ( Windows CMD: java -version)

: JRE .

: , , - : JavaSE-1.8 (jre1.8.0_144)

0

All Articles