--- ./set_soenv.in	2013-03-07 14:35:22.479185120 +0000
+++ ./set_soenv.in	2013-03-07 16:03:02.591310461 +0000
@@ -46,7 +46,7 @@
 #
 # Platform independent constant values.
 my ( $CALL_CDECL, $COMMON_OUTDIR,
-     $common_build, $NO_REC_RES, $SO3, $SOLAR_JAVA,
+     $common_build, $NO_REC_RES, $SO3,
      $SOLAR_PLUGIN, $UPDATER, $VCL,
      $CC, $CXX,
      $ENABLEUNICODE, $NO_BSYMBOLIC);
@@ -63,20 +63,20 @@
 #
 # Help variables.
 my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV, $SOLVER, $CONFIG, $DEFIMGS,
-     $USR_BIN, $USR_LIB, $USR_LOCAL, $USR_CCS, $JAVA_BIN, $JAVA_LIB, $JAVA_INCLUDE,
+     $USR_BIN, $USR_LIB, $USR_LOCAL, $USR_CCS,
      $SOLARENVINC, $USR_DT, $USR_OPENWIN, $XLIB, $XINC,
      $CYGWIN_PATH, $language, @languages, $ASM_PATH, $PERL_PATH, $CL_X64 );
 
 # Environment variables.
-my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL,
+my ( $oldPATH, $SRC_ROOT, $SO_HOME, $OOO_SHELL,
      $L10N_MODULE, $WITH_POOR_HELP_LOCALIZATIONS,
      $UPD, $WORK_STAMP, $gb_REPOS, $BUILD_TYPE,
      $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV, $SOLARDEFIMG,
      $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH,
      $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, $SHOWINCLUDES_PREFIX,
-     $PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB, $JAVALIB,
+     $PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB,
      $SOLARINC, $FRAMEWORKSHOME, $COMEX, $PERL,
-     $COMP_ENV, $ILIB, $JAVAHOME, $WINDOWS_SDK_HOME, $DIRECTXSDK_LIB, $DOTNET_FRAMEWORK_HOME,
+     $COMP_ENV, $ILIB, $WINDOWS_SDK_HOME, $DIRECTXSDK_LIB, $DOTNET_FRAMEWORK_HOME,
      $USE_DIRECTX5, $ATL_LIB, $ATL_INCLUDE, $MFC_LIB, $MFC_INCLUDE, $TMPDIR,
      $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS,
      $WIN_GNUCOPY, $WIN_TOUCH, $MOZILLA_VERSION, $MOZILLA_TOOLKIT, $PREBUILD_MOZAB, $MOZILLABUILD,
@@ -116,8 +116,6 @@
     $PYTHON              = "python";
 }
 $SYSTEM_MOZILLA = '@SYSTEM_MOZILLA@';
-$JDK 		= '@JDK@';
-$JAVAFLAGS 		= '@JAVAFLAGS@';
 $MINGW          = '@WITH_MINGW@';    # use MinGW for Windows build
 $CC             = '@CC@';            # C compiler
 $CXX            = '@CXX@';           # C++ compiler
@@ -128,12 +126,7 @@
 $CL_X64 = '@CL_X64@';
 $GNUMAKE        = "@GNUMAKE@";
 
-# JAVA_HOME as argument from autoconf.
-$JAVA_HOME = PathFormat('@JAVA_HOME@') ;
 
-if ( $platform =~ m/cygwin/ ) {
-   $JAVA_HOME =~ s/[\s\/]+$//;	# remove trailing \n or \/ if there is any.
-}
 #
 #--------------------------------------------------------------------
 # IV. Initialise the warning container and print a note to the user.
@@ -171,7 +164,6 @@
 $common_build         = "";
 $NO_REC_RES           = "TRUE";
 $SO3                  = "TRUE";
-$SOLAR_JAVA           = "@SOLAR_JAVA@";
 $SOLAR_PLUGIN         = "TRUE";
 $UPDATER              = "YES";
 $VCL                  = "TRUE";
@@ -194,10 +186,6 @@
       }
       $CPU            = "I";
       $CPUNAME        = "INTEL";
-	  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-	  $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."xawt";
-	  $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
-
    }
    else
    {
@@ -210,9 +198,6 @@
       }
       $CPU            = "S";
       $CPUNAME        = "SPARC";
-	  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
-	  $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."xawt";
-	  $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
    }
 
    $COM            = "GCC";
@@ -231,33 +216,21 @@
    {  print "Setting NetBSD x86 specific values... ";
       $CPU            = "I";
       $CPUNAME        = "INTEL";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
    }
    elsif ($platform =~ m/^x86_64/)
    {  print "Setting NetBSD x86-64 specific values... ";
       $CPU            = "X";
       $CPUNAME        = "X86_64";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
    }
    elsif ($platform =~ m/^sparc/)
    {  print "Setting NetBSD Sparc specific values... ";
       $CPU            = "S";
       $CPUNAME        = "SPARC";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
    }
    elsif ($platform =~ m/powerpc/)
    {  print "Setting NetBSD PPC specific values... ";
       $CPU            = "P";
       $CPUNAME        = "POWERPC";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
    }
    else
    { print "Unsupported NetBSD architecture: $platform \n";
@@ -294,10 +267,6 @@
       $CPUNAME        = "INTEL";
       $OUTPATH        = "unxkfgi6";
 
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
-
    }
    elsif ($platform =~ m/^x86_64/)
    {  print "Setting GNU/kFreeBSD x86-64 specific values... ";
@@ -306,9 +275,6 @@
       $CPUNAME        = "X86_64";
       $OUTPATH        = "unxkfgx6";
 
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
    }
 
    $INPATH         = $OUTPATH.$PROEXT;
@@ -329,27 +295,12 @@
       print "Setting FreeBSD AMD64 specific values... ";
       $CPU            = "X";
       $CPUNAME        = "X86_64";
-      $JAVA_OS        = '@JAVA_HOME@';
-      $JAVA_OS        =~ s/.*\///;
-      if ($JAVA_OS =~ m/^linux/)
-      {  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-         $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-         $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
-      }
-      else
-      {  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-         $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
-         $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
-      }
    }
    elsif ($platform =~ m/^i386/)
    {  print "Setting FreeBSD x86 specific values... ";
       $CPU            = "I";
       $CPUNAME        = "INTEL";
       $OUTPATH        = "unxfbsdi";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
    }
    else
    {  print "Unsupported FreeBSD architecture: $platform \n";
@@ -373,17 +324,11 @@
       print "Setting OpenBSD AMD64 specific values... ";
       $CPU            = "X";
       $CPUNAME        = "X86_64";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
    }
    elsif ($platform =~ m/^i386/)
    {  print "Setting OpenBSD x86 specific values... ";
       $CPU            = "I";
       $CPUNAME        = "INTEL";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
    }
    else
    {  print "Unsupported OpenBSD architecture: $platform \n";
@@ -409,23 +354,6 @@
       $CPU            = "I";
       $CPUNAME        = "INTEL";
 
-      if ($JDK =~ m/^[Ii][Bb][Mm]/)
-      { $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."bin";
-        $JRETOOLKITDIR = $JAVA_HOME.$ds."jre".$ds."bin".$ds."classic";
-        $JRETHREADDIR  = $JAVA_HOME.$ds."jre".$ds."bin"; }
-
-      elsif ($JDK =~ m/^[Bb][Ee][Aa]/)
-      { $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-        $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."jrockit";
-        $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; }
-
-      else {
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      # has both server and client
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
-      }
-
       $OUTPATH     = "unxlngi6";
    }
    elsif ($platform =~ m/^x86_64/)
@@ -434,11 +362,6 @@
       $CPU            = "X";
       $CPUNAME        = "X86_64";
       $OUTPATH        = "unxlngx6";
-      # Blackdown.org JDK porting project uses `amd64' and `server' in JDK 1.4.2 RC1
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-      # has both server and client
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
    }
    elsif ($platform =~ m/^ia64/)
    {  print "Setting Linux ia64 specific values... ";
@@ -446,9 +369,6 @@
       $CPU            = "A";
       $CPUNAME        = "IA64";
       $OUTPATH        = "unxlnga";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64".$ds."native_threads";
    }
    elsif ($platform =~ m/^sparc/)
 
@@ -457,9 +377,6 @@
       $CPU            = "S";
       $CPUNAME        = "SPARC";
       $OUTPATH        = "unxlngs";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
    }
    elsif ($platform =~ m/^powerpc/)
    {
@@ -468,40 +385,12 @@
          $oldoutfile = "LinuxPPC64Env.Set.sh";
          $OUTPATH = "unxlngppc64";
          $CPUNAME = "POWERPC64";
-
-         if ( $JDK eq "gcj" ) {
-            $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64";
-            $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."client";
-            $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
-         }
-	 # OpenJDK
-	 elsif ($JDK =~ m/sun/) {
-	    $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64";
-	    $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."server";
-	    $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
-	 }
       }
       else {
          print "Setting Linux PPC specific values... ";
          $oldoutfile = "LinuxPPCEnv.Set.sh";
          $OUTPATH = "unxlngppc";
          $CPUNAME = "POWERPC";
-
-         if ( $JDK eq "gcj" ) {
-            $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-            $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
-            $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; }
-         elsif ($JDK =~ m/^[Ii][Bb][Mm]/)
-         {  $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-            $JRETOOLKITDIR = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
-            $JRETHREADDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-         }
-	 # OpenJDK
-	 elsif ($JDK =~ m/sun/) {
-	    $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-	    $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."server";
-	    $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
-	 }
       }
 
       $CPU            = "P";
@@ -523,9 +412,6 @@
 	 $ARCH           = "s390";
          $OUTPATH        = "unxlngs390";
       }
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH;
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
       $CPU            = "3";
    }
    elsif ($platform =~ m/^m68k/)
@@ -534,9 +420,6 @@
       $CPU            = "6";
       $CPUNAME        = "M68K";
       $OUTPATH        = "unxlngm68k";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k".$ds."native_threads";
    }
    elsif ($platform =~ m/^hppa/)
    {  print "Setting Linux hppa specific values... ";
@@ -544,9 +427,6 @@
       $CPU            = "H";
       $CPUNAME        = "HPPA";
       $OUTPATH        = "unxlnghppa";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa".$ds."native_threads";
       $EPM_FLAGS      = "-a hppa";
    }
    elsif ($platform =~ m/^alpha/)
@@ -555,9 +435,6 @@
       $CPU            = "L";
       $CPUNAME        = "AXP";
       $OUTPATH        = "unxlngaxp";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads";
    }
    elsif ($platform =~ m/^arm.*-gnueabi.*/)
    {  print "Setting Linux ARM specific values... ";
@@ -565,9 +442,6 @@
       $CPU            = "R";
       $CPUNAME        = "ARM";
       $OUTPATH        = "unxlngr";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
       $EPM_FLAGS      = "-a arm";
    }
    elsif ($platform =~ m/^arm.*-androideabi/)
@@ -578,9 +452,6 @@
       $CPU            = "R";
       $CPUNAME        = "ARM";
       $OUTPATH        = "unxandr";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
       $EPM_FLAGS      = "-a arm";
    }
    elsif ($platform =~ m/^mips/)
@@ -593,9 +464,6 @@
       if ('@SIZEOF_LONG@' eq '8') {
         if ('@WORDS_BIGENDIAN@' ne 'yes') {
           $EPM_FLAGS = "-a mips64el";
-          if ( $JDK eq "gcj" ) {
-	    $ARCH = "mips64el";
-          }
         }
         else {
           $ARCH = "mips64";
@@ -604,24 +472,13 @@
       else {
         if ('@WORDS_BIGENDIAN@' ne 'yes') {
           $EPM_FLAGS = "-a mipsel";
-	  if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
-	   $ARCH = "mips32"; # Lemote
-	  } else {
-	   $ARCH = "mipsel";
- 	  }
+          $ARCH = "mipsel";
         }
         else {
           $ARCH = "mips";
         }
       }
 
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH;
-      if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
-      	$JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."client"; # Lemote
-      } else {
-      	$JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
-      }
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
    }
 
 
@@ -740,17 +597,11 @@
    {  print "Setting DragonFly i386 specific values... ";
       $CPU            = "I";
       $CPUNAME        = "INTEL";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
    }
    elsif ($platform =~ m/^x86_64/)
    {  print "Setting DragonFly x86-64 specific values... ";
       $CPU            = "X";
       $CPUNAME        = "X86_64";
-      $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
-      $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
-      $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
    }
    else
    { print "Unsupported DragonFly architecture: $platform \n";
@@ -775,9 +626,6 @@
    $CPU            = "P";
    $CPUNAME        = "POWERPC";
    $OUTPATH        = "unxaigppc";
-   $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
-   $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
-   $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
    $COM            = "GCC";
    $COMPATH        = '@COMPATH@';
    $GUI            = "UNX";
@@ -903,10 +751,6 @@
 # Windows NT only variables
 if ($platform =~ m/cygwin/)
 {
-   if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
-   {
-      $JAVA_LIB             = $JAVA_HOME.$LIB;
-   }
    # Import SystemDrive enviroment variable
    use Env qw(SYSTEMDRIVE);
    # Change $SYSTEMDRIVE to lower case.
@@ -920,12 +764,6 @@
    $WIN_TOUCH            = '$CYGWIN_PATH'.$ds."touch.exe";
 }
 
-if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
-{
-   $JAVA_BIN             = $JAVA_HOME.$BIN;
-   $JAVA_INCLUDE         = $JAVA_HOME.$INCLUDE;
-}
-
 
 $PERL                 = PathFormat('@PERL@'); # Perl program
 $PERL_PATH            = dirname('@PERL@'); # Perl Path
@@ -965,14 +803,6 @@
 $SOLARENVINC          = '$SOLARENV'.$INC;
 # Location of dmake resource.
 $DMAKEROOT            = '$SOLARENVINC'.$ds."startup";
-# Location of JDK classes .zip file.
-# but in jdk 1.2 it is called rt.jar and it lives in jre/lib
-$CLASSPATH            = '';
-$CLASSPATH           .= $JAVA_HOME.$ds.'jre'.$LIB.$ds."rt.jar" if (-f $JAVA_HOME.$ds.'jre'.$LIB.$ds."rt.jar");
-$CLASSPATH           .= $wps.'.' if ($CLASSPATH ne '');
-
-# Why do we need XCLASSPATH when it has the exact same value as CLASSPATH?
-$XCLASSPATH           = $CLASSPATH;
 
 # Location of the translations module
 $L10N_MODULE = PathFormat($SRC_ROOT."/translations");
@@ -1020,14 +850,10 @@
 if ($platform =~ m/cygwin/)
 {  $COMP_ENV          = $OUTPATH;
 
-   $JAVAHOME          = $JAVA_HOME;
 
    $ILIB             = $cur_dir;
 
    $ILIB       .=    $wps.$SOLARVER.$ds.$INPATH.$LIB;
-   if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" ) {
-       $ILIB   .= $wps.$JAVA_HOME.$LIB;
-   }
    if ( $CL_X64 ne "TRUE" ) {
        $ILIB   .= $wps.$COMPATH.$LIB.
                   $wps.$WINDOWS_SDK_HOME.$LIB;
@@ -1042,8 +868,6 @@
    # ILIB needs to use '\' directory seperators;
    $ILIB = WinPath( $ILIB, ";" );
 
-   $JAVAHOME          = $JAVA_HOME;
-
 }
 
 # The general environment path.
@@ -1060,11 +884,7 @@
    $PATH             .= $ps.$oldPATH;
 
    my @javaBits;
-   if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME"  &&  $JDK ne "gcj" ) {
-      @javaBits = ( $JAVA_HOME.$BIN, 'javac' );
-   } else {
-      @javaBits = ();
-   }
+   @javaBits = ();
    $PATH              = GetCorrectPath ($PATH,
                                         $COMPATH, $CC,
                                         $PERL_PATH, 'perl',
@@ -1083,22 +903,6 @@
                         $ps.CygFormat($SOLARENV).$ds."bin".
                         $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN;
 
-   if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
-   {
-      # hack either "hotspot" or "client" should be used, depending on the jdk version:
-      # 1.2.x   -   no such directory, unsupported
-      # 1.3.x   -   hotspot, client missing
-      # 1.4.x   -   client, hotspot missing
-
-      $PATH .= $ps.CygFormat($JAVA_HOME).$BIN;
-	  if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) {
-		  $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."hotspot";
-	  }
-	  if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) {
-		  $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."client";
-	  }
-   }
-
    # Add path to compiler
    $tmppath = CygFormat($COMPATH).$BIN;
    $tmppath .= $ds."amd64" if $CL_X64;
@@ -1217,10 +1021,6 @@
                         $L.$USR_OPENWIN.$LIB.
                         $L.$XLIB;
 
-   $JAVALIB          =  $L.$JAVA_HOME.$LIB.
-                        $L.$JRELIBDIR.
-                        $L.$JRETOOLKITDIR.
-                        $L.$JRETHREADDIR;
 }
 elsif ($platform =~ m/linux|netbsd|aix|freebsd|openbsd|dragonfly/)
 {  $SOLARLIB          = $L.$par_dir.$LIB.
@@ -1233,11 +1033,6 @@
    if ( $XLIB ne "/usr/lib" && $XLIB ne "/usr/lib64" && $XLIB ne "no_x_libraries" ) {
       $SOLARLIB       .= $L.$XLIB;
    }
-   $JAVALIB           = '';
-   $JAVALIB          .= $L.$JAVA_HOME.$LIB64 if (-d $JAVA_HOME.$LIB64);
-   $JAVALIB          .= $L.$JRELIBDIR if (-d $JRELIBDIR);
-   $JAVALIB          .= $L.$JRETOOLKITDIR if (-d $JRETOOLKITDIR);
-   $JAVALIB          .= $L.$JRETHREADDIR if (-d $JRETHREADDIR);;
 }
 elsif ($platform =~ m/cygwin|mingw32/)
 {  $SOLARLIB          = $L.$par_dir.$LIB.
@@ -1278,39 +1073,7 @@
 	if ($platform =~ m/openbsd/)
 	{   $SOLARINC  .= $I.$USR_LOCAL.$INCLUDE;
 	}
-    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
-    {   $SOLARINC  .= $I.$JAVA_HOME.$INCLUDE;
-	}
-
-	#include system dependent Java include directory
-	if (!($JDK eq "gcj") && $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
-	{
-   		if ($platform =~ m/solaris/)
-   		{  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."solaris";
-   		}
-   		elsif  ($platform =~ m/linux/)
-   		{  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."linux";
-   		}
-   		elsif ($platform =~ m/freebsd/)
-   		{
-      		$SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."freebsd";
-      		$SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."bsd";
-      		$SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."linux";
-   		}
-   		elsif ($platform =~ m/netbsd/)
-   		{  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."netbsd";
-   		}
-		elsif ( $platform =~ m/aix/ )
-		{  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."aix";
-		}
-		elsif ($platform =~ m/openbsd/)
-		{  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."openbsd";
-		}
-
-   		#java threads include path
 
-        $SOLARINC .=$I.$JAVA_HOME.$INCLUDE.$ds."native_threads".$INCLUDE;
-	}
     #The tail, if needed
     if ($platform =~ m/linux|freebsd|netbsd|aix|openbsd|dragonfly/)
     {  if ( $XINC ne "/usr/include" && $XINC ne 'no_x_includes' ) {
@@ -1319,36 +1082,13 @@
     }
 }
 elsif ($platform =~ m/cygwin/)
-{  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
-   {  $SOLARINC       .= $I.$JAVA_HOME.$INCLUDE.$ds."win32".
-                         $I.$JAVA_HOME.$INCLUDE;
-   }
+{
    $SOLARINC       .= $I.'$WINDOWS_SDK_HOME'.$INCLUDE.
                       $I.'$COMPATH'.$INCLUDE;
    if ( '@ENABLE_DIRECTX@' ne "" ) {
        $SOLARINC   .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE;
    }
 }
-elsif ($platform =~ m/mingw32/)
-{  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
-   {  if (  '@build_os' eq 'cygwin' )
-      {  # Using MinGW from Cygwin. Use the normal Windows JDK
-         # headers
-         $SOLARINC       .= $I.$JAVA_HOME.$INCLUDE.$ds."win32".
-                            $I.$JAVA_HOME.$INCLUDE;
-      }
-      else
-      {  # Cross-compilation. Use our fake jni_md.h
-         # and othewise the build platform JDK headers
-         $SOLARINC       .= $I.$SOLARENVINC.$ds."win32".
-                            $I.$JAVA_HOME.$INCLUDE;
-      }
-   }
-}
-elsif ($platform =~ m/darwin/ && $platform !~ m/^arm/)
-{  $SOLARINC         .= $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Versions".$ds."Current".$ds."Headers".
-                        $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers";
-}
 elsif ($platform =~ m/^arm-apple/)
 {
 }
@@ -1403,12 +1143,7 @@
 
 ToFile( "SRC_ROOT",	     $SRC_ROOT,          "e" );
 ToFile( "OOO_SHELL",         $OOO_SHELL,         "e" );
-ToFile( "JAVA_HOME",         $JAVA_HOME,         "e" );
 ToFile( "L10N_MODULE",       $L10N_MODULE,       "e" );
-ToFile( "ANT_HOME",          PathFormat("@ANT_HOME@"), "e" );
-ToFile( "ANT_LIB",           PathFormat("@ANT_LIB@"), "e" );
-ToFile( "ANT",               PathFormat("@ANT@"), "e" );
-ToFile( "JDKLIB",            $JAVA_LIB,          "e" );
 ToFile( "ASM_PATH",          $ASM_PATH,          "e" );
 ToFile( "ML_EXE",            "@ML_EXE@",         "e" );
 ToFile( "FRAMEWORKSHOME",    $FRAMEWORKSHOME,    "e" );
@@ -1500,38 +1235,14 @@
 ToFile( "ENABLE_PDFIMPORT",  "@ENABLE_PDFIMPORT@", "e" );
 ToFile( "ENABLE_MINIMIZER",   "@ENABLE_MINIMIZER@","e" );
 ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
-ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
-ToFile( "ENABLE_SCRIPTING_BEANSHELL","@ENABLE_SCRIPTING_BEANSHELL@","e" );
-ToFile( "ENABLE_SCRIPTING_JAVASCRIPT","@ENABLE_SCRIPTING_JAVASCRIPT@","e" );
 ToFile( "ENABLE_SCRIPTING_PYTHON","@ENABLE_SCRIPTING_PYTHON@","e" );
 ToFile( "ENABLE_QUICKSTART_LIBPNG", "@ENABLE_QUICKSTART_LIBPNG@", "e" );
-ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" );
 ToFile( "WITH_THEMES",       "@WITH_THEMES@",      "e");
 ToFile( "WITH_HELPPACK_INTEGRATION",       "@WITH_HELPPACK_INTEGRATION@",      "e");
 ToFile( "WITH_EXTENSION_INTEGRATION",       "@WITH_EXTENSION_INTEGRATION@",      "e");
-ToFile( "OOO_JUNIT_JAR",     "@OOO_JUNIT_JAR@",    "e" );
-ToFile( "SAC_JAR",           "@SAC_JAR@",          "e" );
-ToFile( "LIBXML_JAR",        "@LIBXML_JAR@",       "e" );
-ToFile( "FLUTE_JAR",         "@FLUTE_JAR@",        "e" );
-ToFile( "JFREEREPORT_JAR",   "@JFREEREPORT_JAR@",  "e" );
-ToFile( "LIBLAYOUT_JAR",     "@LIBLAYOUT_JAR@",    "e" );
-ToFile( "LIBLOADER_JAR",     "@LIBLOADER_JAR@",    "e" );
-ToFile( "LIBFORMULA_JAR",    "@LIBFORMULA_JAR@",   "e" );
-ToFile( "LIBREPOSITORY_JAR", "@LIBREPOSITORY_JAR@","e" );
-ToFile( "LIBBASE_JAR",       "@LIBBASE_JAR@",      "e" );
-ToFile( "LIBFONTS_JAR",      "@LIBFONTS_JAR@",     "e" );
-ToFile( "LIBSERIALIZER_JAR", "@LIBSERIALIZER_JAR@","e" );
-ToFile( "ENABLE_MEDIAWIKI",  "@ENABLE_MEDIAWIKI@", "e" );
-ToFile( "SYSTEM_APACHE_COMMONS","@SYSTEM_APACHE_COMMONS@","e" );
-ToFile( "COMMONS_CODEC_JAR", "@COMMONS_CODEC_JAR@","e" );
-ToFile( "COMMONS_LANG_JAR",  "@COMMONS_LANG_JAR@", "e" );
-ToFile( "COMMONS_HTTPCLIENT_JAR","@COMMONS_HTTPCLIENT_JAR@","e" );
-ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" );
-ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" );
 ToFile( "SYSTEM_SAMPLEICC", "@SYSTEM_SAMPLEICC@", "e" );
 ToFile( "SAMPLEICC_CFLAGS", "@SAMPLEICC_CFLAGS@", "e" );
 ToFile( "SAMPLEICC_LIBS", "@SAMPLEICC_LIBS@", "e" );
-ToFile( "SERVLETAPI_JAR",    "@SERVLETAPI_JAR@",   "e" );
 ToFile( "ENABLE_DBUS",       "@ENABLE_DBUS@",      "e" );
 ToFile( "DBUS_CFLAGS",       "@DBUS_CFLAGS@",      "e" );
 ToFile( "DBUS_LIBS",         "@DBUS_LIBS@",        "e" );
@@ -1565,7 +1276,6 @@
 # Writing the platform dependent constant values to file.
 # (c = comment, e = environment variable, a = alias )
 ToFile( "Platform dependent constant values.", $empty, "c" );
-ToFile( "SOLAR_JAVA",        $SOLAR_JAVA,        "e" );
 ToFile( "COM",               $COM,               "e" );
 ToFile( "COMPATH",           $COMPATH,           "e" );
 ToFile( "CPU",               $CPU,               "e" );
@@ -1648,9 +1362,6 @@
 
 }
 
-if ("@WITH_VC_REDIST@" eq "TRUE") {
-ToFile( "WITH_VC_REDIST", "TRUE",  "e" );
-}
 ToFile( "PERL",              $PERL,              "e" );
 ToFile( "RPM",               "@RPM@",            "e" );
 ToFile( "DPKG",              "@DPKG@",           "e" );
@@ -1668,27 +1379,6 @@
 ToFile( "SOLARDEFIMG",       $SOLARDEFIMG,       "e" );
 ToFile( "SOLARENVINC",       $SOLARENVINC,       "e" );
 ToFile( "DMAKEROOT",         $DMAKEROOT,         "e" );
-if ( $JDK ne "gcj" ) {
-   ToFile( "CLASSPATH",         $CLASSPATH,         "e" );
-   ToFile( "XCLASSPATH",        $XCLASSPATH,        "e" );
-   ToFile( "JAVACISKAFFE",     '@JAVACISKAFFE@',    "e" );
-}
-else {
-   ToFile( "JAVACISGCJ",       '@JAVACISGCJ@',      "e" );
-}
-ToFile( "AWTLIB",           '@AWTLIB@',          "e" );
-if ( '@JDK@' ne '' )
-{
-   ToFile( "JDK",             "@JDK@",           "e" );
-   ToFile( "JAVAFLAGS",             "@JAVAFLAGS@",           "e" );
-   ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" );
-   ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" );
-   ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" );
-   ToFile( "JAVAIFLAGS",      "@JAVAIFLAGS@",    "e" );
-   ToFile( "JAVACOMPILER",    PathFormat("@JAVACOMPILER@"), "e" );
-   ToFile( "JAVADOC",         PathFormat("@JAVADOC@"), "e" );
-   ToFile( "JVM_ONE_PATH_CHECK", "@JVM_ONE_PATH_CHECK@", "e" );
-}
 ToFile( "SCPDEFS",           '@SCPDEFS@',        "e" );
 ToFile( "SOLAREXTRAINC",     $SOLAREXTRAINC,     "e" );
 ToFile( "SOLAREXTRALIB",     $SOLAREXTRALIB,     "e" );
@@ -1702,10 +1392,8 @@
    ToFile( "PATH",           $PATH,              "e" );
 }
 ToFile( "SOLARLIB",          $SOLARLIB,          "e" );
-ToFile( "JAVALIB",           $JAVALIB,           "e" );
 ToFile( "SOLARINC",          $SOLARINC,          "e" );
 ToFile( "COMP_ENV",          $COMP_ENV,          "e" );
-ToFile( "JAVAHOME",          $JAVAHOME,          "e" );
 ToFile( "CC",                $CC,                "e" );
 ToFile( "SYSBASE",           "$ENV{SYSBASE}",    "e" ) if defined $ENV{SYSBASE};
 ToFile( "CROSS_COMPILING",   "@CROSS_COMPILING@","e" );
@@ -1948,15 +1636,6 @@
 ToFile( "MYSQL_LIB",         "@MYSQL_LIB@",        "e" );
 ToFile( "MYSQL_DEFINES",     "@MYSQL_DEFINES@",    "e" );
 ToFile( "LIBMYSQL_PATH",     "@LIBMYSQL_PATH@",    "e" );
-ToFile( "SYSTEM_HSQLDB",     "@SYSTEM_HSQLDB@",    "e" );
-ToFile( "HSQLDB_JAR",        "@HSQLDB_JAR@",       "e" );
-ToFile( "SYSTEM_LUCENE",     "@SYSTEM_LUCENE@",    "e" );
-ToFile( "LUCENE_CORE_JAR",   "@LUCENE_CORE_JAR@",  "e" );
-ToFile( "LUCENE_ANALYZERS_JAR",   "@LUCENE_ANALYZERS_JAR@",  "e" );
-ToFile( "SYSTEM_BSH",        "@SYSTEM_BSH@",       "e" );
-ToFile( "BSH_JAR",           "@BSH_JAR@",          "e" );
-ToFile( "SYSTEM_SAXON",      "@SYSTEM_SAXON@",     "e" );
-ToFile( "SAXON_JAR",         "@SAXON_JAR@",        "e" );
 ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" );
 ToFile( "SYSTEM_LIBXSLT",    "@SYSTEM_LIBXSLT@",   "e" );
 ToFile( "LIBXSLT_CFLAGS",    "@LIBXSLT_CFLAGS@",   "e" );
@@ -1987,7 +1666,6 @@
 ToFile( "NEON_CFLAGS",       "@NEON_CFLAGS@",      "e" );
 ToFile( "DISABLE_NEON",      "@DISABLE_NEON@",     "e" );
 ToFile( "BUILD_DMAKE",       "@BUILD_DMAKE@",      "e" );
-ToFile( "BUILD_STAX",        "@BUILD_STAX@",       "e" );
 ToFile( "BUILD_UNOWINREG",   "@BUILD_UNOWINREG@",  "e" );
 ToFile( "USE_XINERAMA",      "@USE_XINERAMA@",     "e" );
 ToFile( "XINERAMA_LINK",     "@XINERAMA_LINK@",    "e" );
