Merge branch 'openjdk' into 8u152_1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8f0341b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+corba/
+hotspot/
+jaxp/
+jaxws/
+jdk/
+langtools/
+nashorn/
+get_source.sh
\ No newline at end of file
diff --git a/README b/README
deleted file mode 100644
index 40c9fbc..0000000
--- a/README
+++ /dev/null
@@ -1,40 +0,0 @@
-README:
-  This file should be located at the top of the OpenJDK Mercurial root
-  repository. A full OpenJDK repository set (forest) should also include
-  the following 6 nested repositories:
-    "jdk", "hotspot", "langtools", "corba", "jaxws"  and "jaxp".
-
-  The root repository can be obtained with something like:
-    hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
-  
-  You can run the get_source.sh script located in the root repository to get
-  the other needed repositories:
-    cd openjdk8 && sh ./get_source.sh
-
-  People unfamiliar with Mercurial should read the first few chapters of
-  the Mercurial book: http://hgbook.red-bean.com/read/
-
-  See http://openjdk.java.net/ for more information about OpenJDK.
-
-Simple Build Instructions:
-  
-  0. Get the necessary system software/packages installed on your system, see
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
-
-  1. If you don't have a jdk7u7 or newer jdk, download and install it from
-     http://java.sun.com/javase/downloads/index.jsp
-     Add the /bin directory of this installation to your PATH environment
-     variable.
-
-  2. Configure the build:
-       bash ./configure
-  
-  3. Build the OpenJDK:
-       make all
-     The resulting JDK image should be found in build/*/images/j2sdk-image
-
-where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
-is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
-
-Complete details are available in the file:
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..787473b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,147 @@
+#Downloads
+
+|Windows-x86  |Windows-x64  |macOS        |Linux-x86    |Linux-x64    |
+|-------------|-------------|-------------|-------------|-------------|
+|<a href="https://bintray.com/jetbrains/intellij-jdk/openjdk8-windows-x86/_latestVersion"> <img src="https://api.bintray.com/packages/jetbrains/intellij-jdk/openjdk8-windows-x86/images/download.svg"/></a>|<a href="https://bintray.com/jetbrains/intellij-jdk/openjdk8-windows-x64/_latestVersion"> <img src="https://api.bintray.com/packages/jetbrains/intellij-jdk/openjdk8-windows-x64/images/download.svg"/></a>|<a href="https://bintray.com/jetbrains/intellij-jdk/openjdk8-osx-x64/_latestVersion"> <img src="https://api.bintray.com/packages/jetbrains/intellij-jdk/openjdk8-osx-x64/images/download.svg"/></a>|<a href="https://bintray.com/jetbrains/intellij-jdk/openjdk8-linux-x86/_latestVersion"> <img src="https://api.bintray.com/packages/jetbrains/intellij-jdk/openjdk8-linux-x86/images/download.svg"/></a>|<a href="https://bintray.com/jetbrains/intellij-jdk/openjdk8-linux-x64/_latestVersion"><img src="https://api.bintray.com/packages/jetbrains/intellij-jdk/openjdk8-linux-x64/images/download.svg"/></a>|
+
+
+#How JetBrains Runtime is organised
+##Workspaces
+
+[github.com/JetBrains/jdk8u](https://github.com/JetBrains/jdk8u/)  
+[github.com/JetBrains/jdk8u_corba](https://github.com/JetBrains/jdk8u_corba/)  
+[github.com/JetBrains/jdk8u_hotspot](https://github.com/JetBrains/jdk8u_hotspot/)  
+[github.com/JetBrains/jdk8u_jaxp](https://github.com/JetBrains/jdk8u_jaxp/)  
+[github.com/JetBrains/jdk8u_jaxws](https://github.com/JetBrains/jdk8u_jaxws/)  
+[github.com/JetBrains/jdk8u_jdk](https://github.com/JetBrains/jdk8u_jdk/)  
+[github.com/JetBrains/jdk8u_langtools](https://github.com/JetBrains/jdk8u_langtools/)  
+[github.com/JetBrains/jdk8u_nashorn](https://github.com/JetBrains/jdk8u_nashorn/)  
+
+Usually, we do not modify any of the repositories except [jdk](https://github.com/JetBrains/jdk8u_jdk/) module. Other repositories are needed for build purposes.
+##Getting sources
+__OSX, Linux:__
+```
+git config --global core.autocrlf true
+git clone git@github.com:JetBrains/jdk8u.git
+cd jdk8u
+./getModules.sh
+```
+
+__Windows:__
+```
+git config --global core.autocrlf false
+git clone git@github.com:JetBrains/jdk8u.git
+cd jdk8u
+getModules.bat
+```
+
+#Configure Local Build Environment
+##Linux
+```
+sudo apt-get install git zip bzip2 unzip tar curl
+sudo apt-get install ccache make gcc g++ ca-certificates ca-certificates-java
+sudo apt-get install libxext-dev libxrender-dev libxtst-dev libxt-dev
+sudo apt-get install libasound2-dev libcups2-dev libfreetype6-dev
+git clone git@github.com:JetBrains/jdk8u.git
+cd jdk8u
+./getModules.sh
+download jdk8 from Oracle into /home/user/jdk1.8.0_102
+export JAVA_HOME=/home/user/jdk1.8.0_102
+sh ./configure
+make
+```
+
+##Windows
+
+Install:
+
+* [Cygwin x64](http://www.cygwin.com/)
+  Required packages (binutils, cpio, diffutils, file, gawk, gcc-core, make, m4, unzip, zip)
+* Windows SDK 7.1 offline installer [GRMSDKX_EN_DVD.iso](https://download.microsoft.com/download/F/1/0/F10113F5-B750-4969-A255-274341AC6BCE/GRMSDKX_EN_DVD.iso)
+Run Setup\SDKSetup 
+* Visual Studio Express 2010 offline installer [VS2010Express1.iso](http://download.microsoft.com/download/1/E/5/1E5F1C0A-0D5B-426A-A603-1798B951DDAE/VS2010Express1.iso)
+  * [Virtual CloneDrive](http://www.elby.ch/products/vcd.html) may help to mount ISO images
+* [DirectX 9.0 SDK](http://www.microsoft.com/en-us/download/details.aspx?id=6812)
+* [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
+
+Build Freetype:
+* Download [sources](https://www.freetype.org/download.html)
+* Execute the following script in builds\windows\vc2010
+```
+(echo ^<?xml version="1.0" encoding="utf-8"?^>
+echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^>
+echo ^<PropertyGroup Label="Globals"^>
+echo ^<TargetName^>freetype^</TargetName^>
+echo ^<UserIncludeDirectories^>.^</UserIncludeDirectories^>
+echo ^</PropertyGroup^>
+echo ^<ItemDefinitionGroup^>
+echo ^<ClCompile^>
+echo ^<ForcedIncludeFiles^>jb_custom.h^</ForcedIncludeFiles^>
+echo ^</ClCompile^>
+echo ^</ItemDefinitionGroup^>
+echo ^</Project^>) > freetype.user.props
+(echo #ifndef __JB_CUSTOM_H__
+echo #define __JB_CUSTOM_H__
+echo #define FT_EXPORT^(x^) __declspec^(dllexport^) x
+echo #define FT_BASE^(x^) __declspec^(dllexport^) x
+echo #endif) > jb_custom.h
+```
+* Build with VC Express for **x64** or **win32** target
+* Put freetype.dll, freetype.lib, freetype.exp in lib folder at the same level with include:
+```
+freetype
+  include
+  lib
+```
+
+Configure and run make  in cygwin shell 
+* __32 bit__ (use --with-msvcr-dll=/cygdrive/c/windows/SysWOW64/msvcr100.dll on 64 bit windows)
+```    
+  cd /cygdrive/c/jdk8/
+ ./configure  --with-target-bits=32 --with-freetype=/cygdrive/freetype/  
+  make images
+```
+* __64 bit__
+```    
+  cd /cygdrive/c/jdk8/
+ ./configure  --with-target-bits=64 --with-freetype=/cygdrive/freetype/  
+  make images
+```
+
+##OSX
+XCode
+* Login to https://developer.apple.com with your Apple ID. Download 
+[Xcode 4.6.3](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.6.3/xcode4630916281a.dmg)
+and put Xcode.app into /Applications/Xcode4
+
+_The latest XCode can be used, but you need to run make with COMPILER_WARNINGS_FATAL=false_
+
+Command Line Tools
+* Download and install Command Line Tools via XCode Preferences / Downloads or from https://developer.apple.com (for example, [Command Line Tools, April 2014](https://developer.apple.com/downloads/download.action?path=Developer_Tools/command_line_tools_os_x_mountain_lion_for_xcode__april_2014/command_line_tools_for_osx_mountain_lion_april_2014.dmg) for OS X Mountain Lion).
+
+Freetype
+* Install [XQuartz](https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.9.dmg) or build Freetype from 
+ [sources](https://www.freetype.org/download.html)
+```
+cd freetype
+./configure
+./make
+mkdir lib
+cp objs/.libs/libfreetype.dylib lib/
+```
+
+Configure and build jdk
+```
+export MACOSX_DEPLOYMENT_TARGET=10.8
+cd /path_to_jdk8/
+bash configure --with-xcode-path=/Applications/Xcode4/Xcode4.app --with-freetype=/opt/X11/lib --with-freetype-include=/usr/X11/include/freetype2
+make images
+```
+or
+```
+make COMPILER_WARNINGS_FATAL=false images
+```
+for the latest XCode
+
+##Contribution
+We will be happy to receive your pull requests. Before you submit one, please sign our Contributor License Agreement (CLA)  https://www.jetbrains.com/agreements/cla/ 
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index c9d7429..396898d 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -19365,7 +19365,7 @@
     # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later
     XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
     XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
-    if test ! "${XC_VERSION_PARTS[0]}" = "4"; then
+    if test ! ${XC_VERSION_PARTS[0]} -ge 4 ; then
       as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5
     fi
 
@@ -20389,13 +20389,13 @@
   else
     COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
     # Check that this is likely to be GCC.
-    $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
+    $COMPILER --version 2>&1 | $GREP -E "Apple LLVM version|Free Software Foundation" > /dev/null
     if test $? -ne 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
-$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required compiler." >&5
+$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required compiler." >&6;}
       { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;}
-      as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      as_fn_error $? "clang or GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
     fi
 
     # First line typically looks something like:
@@ -21991,13 +21991,13 @@
   else
     COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
     # Check that this is likely to be GCC.
-    $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
+    $COMPILER --version 2>&1 | $GREP -E "Apple LLVM version|Free Software Foundation" > /dev/null
     if test $? -ne 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
-$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required compiler." >&5
+$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required compiler." >&6;}
       { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;}
-      as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      as_fn_error $? "clang or GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
     fi
 
     # First line typically looks something like:
@@ -29734,7 +29734,6 @@
       COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
       -pipe \
       -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
-      CXXSTD_CXXFLAG="-std=gnu++98"
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS\"" >&5
 $as_echo_n "checking if the C++ compiler supports \"$CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS\"... " >&6; }
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index 1af8fa3..b5a09b3 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -122,11 +122,11 @@
   else
     COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
     # Check that this is likely to be GCC.
-    $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
+    $COMPILER --version 2>&1 | $GREP -E "Apple LLVM version|Free Software Foundation" > /dev/null
     if test $? -ne 0; then
-      AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler.])
+      AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required compiler.])
       AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"])
-      AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.])
+      AC_MSG_ERROR([clang or GCC compiler is required. Try setting --with-tools-dir.])
     fi
 
     # First line typically looks something like:
@@ -341,7 +341,7 @@
     # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later
     XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
     XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
-    if test ! "${XC_VERSION_PARTS[[0]]}" = "4"; then
+    if test ! ${XC_VERSION_PARTS[[0]]} -ge 4 ; then
       AC_MSG_ERROR([Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select.])
     fi
 
diff --git a/getModules.bat b/getModules.bat
new file mode 100644
index 0000000..b5bfea9
--- /dev/null
+++ b/getModules.bat
@@ -0,0 +1,7 @@
+call git clone git@github.com:JetBrains/jdk8u_corba.git corba
+call git clone git@github.com:JetBrains/jdk8u_hotspot.git hotspot
+call git clone git@github.com:JetBrains/jdk8u_jaxp.git jaxp
+call git clone git@github.com:JetBrains/jdk8u_jaxws.git jaxws
+call git clone git@github.com:JetBrains/jdk8u_jdk.git jdk
+call git clone git@github.com:JetBrains/jdk8u_langtools.git langtools
+call git clone git@github.com:JetBrains/jdk8u_nashorn.git nashorn
\ No newline at end of file
diff --git a/getModules.sh b/getModules.sh
new file mode 100755
index 0000000..246df3c
--- /dev/null
+++ b/getModules.sh
@@ -0,0 +1,7 @@
+git clone git@github.com:JetBrains/jdk8u_corba.git corba
+git clone git@github.com:JetBrains/jdk8u_hotspot.git hotspot
+git clone git@github.com:JetBrains/jdk8u_jaxp.git jaxp
+git clone git@github.com:JetBrains/jdk8u_jaxws.git jaxws
+git clone git@github.com:JetBrains/jdk8u_jdk.git jdk
+git clone git@github.com:JetBrains/jdk8u_langtools.git langtools
+git clone git@github.com:JetBrains/jdk8u_nashorn.git nashorn
\ No newline at end of file
diff --git a/get_source.sh b/get_source.sh
deleted file mode 100644
index 72049bd..0000000
--- a/get_source.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-to_stderr() {
-    echo "$@" >&2
-}
-
-error() {
-    to_stderr "ERROR: $1"
-    exit ${2:-126}
-}
-
-warning() {
-    to_stderr "WARNING: $1"
-}
-
-version_field() {
-  # rev is typically omitted for minor and major releases
-  field=`echo ${1}.0 | cut -f ${2} -d .`
-  if expr 1 + $field >/dev/null 2> /dev/null; then
-    echo $field
-  else
-    echo -1
-  fi
-}
-
-# Version check
-
-# required
-reqdmajor=1
-reqdminor=4
-reqdrev=0
-
-# requested
-rqstmajor=2
-rqstminor=6
-rqstrev=3
-
-
-# installed
-hgwhere="`command -v hg`"
-if [ "x$hgwhere" = "x" ]; then
-  error "Could not locate Mercurial command"
-fi
-
-hgversion="`LANGUAGE=en hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
-if [ "x${hgversion}" = "x" ] ; then
-  error "Could not determine Mercurial version of $hgwhere"
-fi
-
-hgmajor="`version_field $hgversion 1`"
-hgminor="`version_field $hgversion 2`"
-hgrev="`version_field $hgversion 3`"
-
-if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
-  error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
-fi
-
-
-# Require
-if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then
-  error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
-fi
-
-
-# Request
-if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then
-  warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
-fi
-
-
-# Get clones of all absent nested repositories (harmless if already exist)
-sh ./common/bin/hgforest.sh clone "$@" || exit $?
-
-# Update all existing repositories to the latest sources
-sh ./common/bin/hgforest.sh pull -u
diff --git a/idea/java/.idea/gradle.xml b/idea/java/.idea/gradle.xml
new file mode 100644
index 0000000..a5c3ae1
--- /dev/null
+++ b/idea/java/.idea/gradle.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleJvm" value="1.8" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+          </set>
+        </option>
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/idea/java/.idea/misc.xml b/idea/java/.idea/misc.xml
new file mode 100644
index 0000000..c221fde
--- /dev/null
+++ b/idea/java/.idea/misc.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="JBSDK" project-jdk-type="JavaSDK" />
+</project>
\ No newline at end of file
diff --git a/idea/java/.idea/modules.xml b/idea/java/.idea/modules.xml
new file mode 100644
index 0000000..2808ed4
--- /dev/null
+++ b/idea/java/.idea/modules.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/java.iml" filepath="$PROJECT_DIR$/.idea/modules/java.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/java_main.iml" filepath="$PROJECT_DIR$/.idea/modules/java_main.iml" group="java" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/java_test.iml" filepath="$PROJECT_DIR$/.idea/modules/java_test.iml" group="java" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/idea/java/.idea/modules/java.iml b/idea/java/.idea/modules/java.iml
new file mode 100644
index 0000000..f5a1219
--- /dev/null
+++ b/idea/java/.idea/modules/java.iml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.id="java" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../..">
+      <excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
+      <excludeFolder url="file://$MODULE_DIR$/../../build" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/idea/java/.idea/runConfigurations/make_clean.xml b/idea/java/.idea/runConfigurations/make_clean.xml
new file mode 100644
index 0000000..bce98e6
--- /dev/null
+++ b/idea/java/.idea/runConfigurations/make_clean.xml
@@ -0,0 +1,13 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="make clean" type="GroovyScriptRunConfiguration" factoryName="Groovy">
+    <module name="java" />
+    <setting name="path" value="file://$PROJECT_DIR$/build.gradle" />
+    <setting name="vmparams" value="" />
+    <setting name="params" value="-q make_clean" />
+    <setting name="workDir" value="file://$PROJECT_DIR$" />
+    <setting name="debug" value="false" />
+    <method>
+      <option name="Make" enabled="false" />
+    </method>
+  </configuration>
+</component>
\ No newline at end of file
diff --git a/idea/java/.idea/runConfigurations/make_images.xml b/idea/java/.idea/runConfigurations/make_images.xml
new file mode 100644
index 0000000..ec5fbae
--- /dev/null
+++ b/idea/java/.idea/runConfigurations/make_images.xml
@@ -0,0 +1,13 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="make images" type="GroovyScriptRunConfiguration" factoryName="Groovy">
+    <module name="java" />
+    <setting name="path" value="file://$PROJECT_DIR$/build.gradle" />
+    <setting name="vmparams" value="" />
+    <setting name="params" value="-q make_images" />
+    <setting name="workDir" value="file://$PROJECT_DIR$" />
+    <setting name="debug" value="false" />
+    <method>
+      <option name="Make" enabled="false" />
+    </method>
+  </configuration>
+</component>
\ No newline at end of file
diff --git a/idea/java/.idea/vcs.xml b/idea/java/.idea/vcs.xml
new file mode 100644
index 0000000..cdeb408
--- /dev/null
+++ b/idea/java/.idea/vcs.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../corba" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../hotspot" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../jaxp" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../jaxws" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../jdk" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../langtools" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../nashorn" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/idea/java/build.gradle b/idea/java/build.gradle
new file mode 100644
index 0000000..7f22f9a
--- /dev/null
+++ b/idea/java/build.gradle
@@ -0,0 +1,86 @@
+apply plugin: 'java'
+
+import org.gradle.internal.os.OperatingSystem
+
+repositories {
+    mavenCentral()
+}
+
+configurations {
+    antClasspath
+}
+
+def test_jvm = {
+    if (OperatingSystem.current().isMacOsX()) {
+        file('../../build/macosx-x86_64-normal-server-release/images/j2sdk-bundle/jdk1.8.0.jdk/Contents/Home/bin/java').absolutePath
+    } else if (OperatingSystem.current().isLinux()) {
+        file('../../build/linux-x86_64-normal-server-release/images/j2sdk-image/bin/java').absolutePath
+    } else {
+        file('../../build/windows-x86_64-normal-server-release/images/j2sdk-image/bin/java.exe').absolutePath
+    }
+}
+
+dependencies {
+    antClasspath 'ant-contrib:ant-contrib:20020829', 'org.apache.ant:ant-junit:1.8.1'
+    testCompile('junit:junit:4.12'){
+        exclude group: 'org.hamcrest'
+    }
+    testCompile 'org.hamcrest:hamcrest-library:1.3'
+}
+
+
+// add additional jars to the AntBuilder classpath for use within the imported build.
+ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader
+configurations.antClasspath.each { File f ->
+    antClassLoader.addURL(f.toURI().toURL())
+}
+
+ant.importBuild('../../jdk/idea/java/tests/perf_tests.xml') { antTargetName ->
+    'jdk-perf-' + antTargetName
+}
+
+ant.properties.test_jvm = test_jvm()
+
+println ant.properties.test_jvm
+
+if (OperatingSystem.current().isMacOsX())
+    sourceSets.main.java.srcDirs =
+        ["../../jdk/src/share/classes",
+         "../../jdk/src/macosx/classes",
+        ]
+else if (OperatingSystem.current().isLinux())
+    sourceSets.main.java.srcDirs =
+        ["../../jdk/src/share/classes",
+         "../../jdk/src/solaris/classes"
+        ]
+else
+    sourceSets.main.java.srcDirs =
+        ["../../jdk/src/share/classes",
+         "../../jdk/src/windows/classes",
+        ]
+
+sourceSets.test.java.srcDirs = ["../../jdk/idea/java/tests/src"]
+
+def buildDir = project.buildscript.sourceFile.parentFile.parentFile.parentFile
+
+task make_images << {
+    def pb = new ProcessBuilder().command("make", "-C", buildDir.absolutePath,
+            " COMPILER_WARNINGS_FATAL=false", "images")
+    def proc = pb.redirectErrorStream(true).start()
+    proc.inputStream.eachLine {println it}
+    assert proc.waitFor() == 0
+}
+
+task make_clean << {
+    def pb = new ProcessBuilder().command("make", "-C", buildDir.absolutePath,
+            " COMPILER_WARNINGS_FATAL=false", "clean")
+    def proc = pb.redirectErrorStream(true).start()
+    proc.inputStream.eachLine {println it}
+    assert proc.waitFor() == 0
+}
+
+tasks.compileJava.enabled = false
+tasks.compileTestJava.dependsOn.clear()
+classes.dependsOn.clear()
+classes.dependsOn tasks.make_images, tasks.compileTestJava
+tasks.cleanClasses.dependsOn tasks.make_clean