Oxygene with java 11

Is it possible to configure Oxygene/Elements/VisualStudio for use with OpenJDK 11 or above?

Hi Mark,

Elements should work with any version of Java from 7 (oldest one we ever tested) up to the latest. It will automatically pick top the version installed, but you can also manually provide a path to override it, if yu have more than one version installed, or have it installed in a n on-default way/location.

see Setting up the Java Development Kit for Visual Studio for more details.

Did you run into any problems, or just asking preemptively?

yours,
marc

I cannot create a java console app under OpenJDK 11.

Synopsis:
Windows 10
MS Visual Studio 2019 with Elements.10.0.0.2557

Newly installed AdoptOpenJDK 11 (both JDK and JRE) so that

> java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)

Options in MS Visual Studio:

Continue with: File/New/Project…/ Console Application (Java)

Program.pas with ‘The magic happens here.’ appears.

References include cooper and rt. The latter is not resolved (yellow triangle).

Build yields:

|Error||() Reference ‘rt’ could not be resolved for target ‘Cooper’ (Cooper Plain jvm).|consoleapplication3|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\RemObjects Software\Elements\RemObjects.Elements.Cooper.targets|53||

Which is expected, because there is no rt.jar in OpenJDK 11.

So, what to do in this case?

Mark,

first of all, can you update to a more recent Elements build, jic? 2557 is a few months behind.

Can yu turn on the most details log level under Tools|Options, P{projects & Solutions, do a Clean/Rebuild, and send me the complete build log? it might give more details as to why it cannot resolve the rt reference.

I assume the Java Runtime and Java SDK paths as set in the dialog above are valid and exist?

thanx,
marc

Checked with Elements 10.0.0.2587. It behaves exactly the same.

As much as I can see, the problem is that your project template (or some other mechanism while creating a project) requires a reference to rt.jar. But newer java distributions, including OpenJDK 11 and AdoptOpenJDK 11, do not include rt.jar any more. This is well known, see for instance

So, the question is how to configure an Oxygene project to cope with this. What else is required to get it working? How do you test your system with Java JDK 11+? Sorry, I could not find any related documentation.

For what it is worth, this is the Clean/Rebuild log:

1>------ Rebuild All started: Project: consoleapplication1, Configuration: Debug ------
1>Build started.
1>Project "consoleapplication1.elements" (ReBuild target(s)):
1>Initial properties:
1>  ALLUSERSPROFILE                = C:\ProgramData
1>  AndroidTargetsPath             = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\MDD\Android\V150\
1>  APPDATA                        = C:\Users\mare\AppData\Roaming
1>  AssemblyName                   = consoleapplication1
1>  BuildingInsideVisualStudio     = true
1>  BuildingProject                = false
1>  BuildProjectReferences         = true
1>  CommonProgramFiles             = C:\Program Files (x86)\Common Files
1>  CommonProgramW6432             = C:\Program Files\Common Files
1>  ComputeIntermediateSatelliteAssembliesDependsOn = 
1>  ComputerID                     = NOT
1>  COMPUTERNAME                   = DECISION
1>  ComSpec                        = C:\WINDOWS\system32\cmd.exe
1>  ConditionalDefines             = DEBUG;TRACE;
1>  Configuration                  = Debug
1>  CpuType                        = anycpu
1>  CurrentSolutionConfigurationContents = <SolutionConfiguration>
1><ProjectConfiguration Project="{87b6eed5-ca67-4ec9-bb4b-48efb1bed992}" AbsolutePath="D:\RemObjects\consoleapplication1\consoleapplication1.elements">Debug</ProjectConfiguration>
1></SolutionConfiguration>
1>  DevEnvDir                      = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\
1>  Device                         = true
1>  Disks                          = C: D:
1>  DriverData                     = C:\Windows\System32\Drivers\DriverData
1>  EBuildMSBuildProjectFile       = consoleapplication1.elements
1>  EBuildXmlDetailsFile           = D:\RemObjects\consoleapplication1\obj\Debug\consoleapplication1.xml
1>  EnableAsserts                  = True
1>  EnableUnmanagedDebugging       = False
1>  FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
1>  FPS_BROWSER_USER_PROFILE_STRING = Default
1>  Framework20Dir                 = @(_TargetFramework20DirectoryItem)
1>  Framework30Dir                 = @(_TargetFramework30DirectoryItem)
1>  Framework35Dir                 = @(_TargetFramework35DirectoryItem)
1>  Framework40Dir                 = @(_TargetFramework40DirectoryItem)
1>  FrameworkSDKRoot               = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\
1>  GenerateDebugInfo              = True
1>  GetTargetPathDependsOn         = ;
1>  HOMEDRIVE                      = C:
1>  HOMEPATH                       = \Users\mare
1>  iOSTargetsPath                 = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\MDD\iOS\V150\
1>  IsFullBuild                    = true
1>  LOCALAPPDATA                   = C:\Users\mare\AppData\Local
1>  LOGONSERVER                    = \\DECISION
1>  Mode                           = Cooper
1>  MSBuildAllProjects             = D:\RemObjects\consoleapplication1\consoleapplication1.elements
1>  MSBuildAssemblyVersion         = 16.0
1>  MSBuildBinPath                 = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
1>  MSBuildExtensionsPath          = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild
1>  MSBuildExtensionsPath32        = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild
1>  MSBuildExtensionsPath64        = C:\Program Files\MSBuild
1>  MSBuildFrameworkToolsPath      = C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\
1>  MSBuildFrameworkToolsPath32    = C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\
1>  MSBuildFrameworkToolsPath64    = C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\
1>  MSBuildFrameworkToolsRoot      = C:\WINDOWS\Microsoft.NET\Framework\
1>  MSBuildLoadMicrosoftTargetsReadOnly = true
1>  MSBuildNodeCount               = 1
1>  MSBuildProgramFiles32          = C:\Program Files (x86)
1>  MSBuildProjectDefaultTargets   = Build
1>  MSBuildProjectDirectory        = D:\RemObjects\consoleapplication1
1>  MSBuildProjectDirectoryNoRoot  = RemObjects\consoleapplication1
1>  MSBuildProjectExtension        = .elements
1>  MSBuildProjectFile             = consoleapplication1.elements
1>  MSBuildProjectFullPath         = D:\RemObjects\consoleapplication1\consoleapplication1.elements
1>  MSBuildProjectName             = consoleapplication1
1>  MSBuildRuntimeType             = Full
1>  MSBuildRuntimeVersion          = 4.0.30319
1>  MSBuildSDKsPath                = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Sdks
1>  MSBuildStartupDirectory        = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE
1>  MSBuildToolsPath               = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
1>  MSBuildToolsPath32             = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
1>  MSBuildToolsPath64             = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64
1>  MSBuildToolsRoot               = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild
1>  MSBuildToolsVersion            = Current
1>  MSBuildUserExtensionsPath      = C:\Users\mare\AppData\Local\Microsoft\MSBuild
1>  MSBuildVersion                 = 16.7.0
1>  Name                           = consoleapplication1
1>  NUMBER_OF_PROCESSORS           = 8
1>  OneDrive                       = D:\_OneDrive\OneDrive
1>  OneDriveConsumer               = D:\_OneDrive\OneDrive
1>  Optimize                       = False
1>  OS                             = Windows_NT
1>  OutOfProcess                   = true
1>  OutputPath                     = .\Bin\Debug
1>  OutputType                     = Executable
1>  Path                           = C:\Program Files\AdoptOpenJDK\jre-11.0.9.101-hotspot\bin;C:\Program Files\AdoptOpenJDK\jdk-11.0.9.101-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\ImageMagick-7.0.9-Q16;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\RemObjects Software\Elements\bin;C:\Program Files\dotnet\;C:\Users\mare\AppData\Local\Microsoft\WindowsApps;C:\Users\mare\.dotnet\tools;
1>  PATHEXT                        = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
1>  PkgDefApplicationConfigFile    = C:\Users\mare\AppData\Local\Microsoft\VisualStudio\16.0_3f6b0584\devenv.exe.config
1>  PrepareResourceNamesDependsOn  = 
1>  PROCESSOR_ARCHITECTURE         = x86
1>  PROCESSOR_ARCHITEW6432         = AMD64
1>  PROCESSOR_IDENTIFIER           = Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
1>  PROCESSOR_LEVEL                = 6
1>  PROCESSOR_REVISION             = 8e0c
1>  ProductVersion                 = 3.5
1>  ProgramData                    = C:\ProgramData
1>  ProgramFiles                   = C:\Program Files (x86)
1>  ProgramW6432                   = C:\Program Files
1>  ProjectGuid                    = {87B6EED5-CA67-4EC9-BB4B-48EFB1BED992}
1>  PSModulePath                   = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
1>  PUBLIC                         = C:\Users\Public
1>  RootNamespace                  = consoleapplication1
1>  RoslynTargetsPath              = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn
1>  SDK35ToolsPath                 = 
1>  SDK40ToolsPath                 = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
1>  ServiceHubLogSessionKey        = 3A5331E3
1>  SESSIONNAME                    = Console
1>  Settings                       = TreatFixableErrorsAsWarnings=True;
1>  Simulator                      = false
1>  SolutionDir                    = D:\RemObjects\consoleapplication1\
1>  SolutionExt                    = .sln
1>  SolutionFileName               = consoleapplication1.sln
1>  SolutionName                   = consoleapplication1
1>  SolutionPath                   = D:\RemObjects\consoleapplication1\consoleapplication1.sln
1>  SubMode                        = Plain
1>  SystemDrive                    = C:
1>  SystemRoot                     = C:\WINDOWS
1>  TargetFrameworkSDKToolsDirectory = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
1>  TEMP                           = C:\Users\mare\AppData\Local\Temp
1>  ThreadedWaitDialogDpiContext   = -4
1>  TMP                            = C:\Users\mare\AppData\Local\Temp
1>  USERDOMAIN                     = DECISION
1>  USERDOMAIN_ROAMINGPROFILE      = DECISION
1>  USERNAME                       = mare
1>  USERPROFILE                    = C:\Users\mare
1>  UsesEBuild                     = True
1>  UTFOutput                      = true
1>  VCTargetsPath                  = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\
1>  VCTargetsPath10                = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\
1>  VCTargetsPath11                = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\
1>  VCTargetsPath12                = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\
1>  VCTargetsPath14                = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\
1>  Verbosity                      = diagnostic
1>  VisualStudioDir                = C:\Users\mare\Documents\Visual Studio 2019
1>  VisualStudioEdition            = Microsoft Visual Studio Community 2019
1>  VisualStudioStyleErrors        = true
1>  VisualStudioVersion            = 16.0
1>  VSAPPIDDIR                     = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\
1>  VSAPPIDNAME                    = devenv.exe
1>  VSIDEResolvedNonMSBuildProjectOutputs = <VSIDEResolvedNonMSBuildProjectOutputs />
1>  VsInstallRoot                  = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
1>  VSLANG                         = 1033
1>  VSSKUEDITION                   = Community
1>  windir                         = C:\WINDOWS
1>  WindowsSDK80Path               = 
1>Initial items:
1>Reference
1>  rt.jar
1>Reference
1>  cooper.jar
1>Compile
1>  Program.pas
1>AvailableItemName
1>  Resource
1>Building with tools version "Current".
1>Project file contains ToolsVersion="4.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="Current". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424.
1>Target "_ValidateEBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\RemObjects Software\Elements\RemObjects.Elements.Cooper.targets" from project "D:\RemObjects\consoleapplication1\consoleapplication1.elements" (entry point):
1>Target "BeforeBuild" skipped, due to false condition; ('$(BuildingInsideVisualStudio)'!='true') was evaluated as ('true'!='true').
1>Target "Rebuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\RemObjects Software\Elements\RemObjects.Elements.Cooper.targets" from project "D:\RemObjects\consoleapplication1\consoleapplication1.elements" (entry point):
1>	Using "MSBuildTask" task from assembly "RemObjects.EBuild.MSBuild, Version=10.0.0.2587, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098".
1>	Task "MSBuildTask"
1>		Task Parameter:Goal=Rebuild
1>		Task Parameter:ProjectFile=consoleapplication1.elements
1>		Task Parameter:Configuration=Debug
1>		Task Parameter:XmlDetailsFile=D:\RemObjects\consoleapplication1\obj\Debug\consoleapplication1.xml
1>		Task Parameter:Verbosity=diagnostic
1>		Task Parameter:Device=True
1>		Task Parameter:Simulator=False
1>		Task Parameter:MaximumMessageCount=1000
1>		Task Parameter:OutOfProcess=True
1>		Task Parameter:OutputPath=.\Bin\Debug
1>		Task Parameter:Settings=TreatFixableErrorsAsWarnings=True;
1>		RemObjects EBuild. An open source build engine for Elements and beyond.
1>		Copyright RemObjects Software 2016-2021. All Rights Reserved. Created by marc hoffman.
1>		Version 10.0.0.2587 (develop) built on bajor, 20210101-113311. Commit 026cf1d.
1>		   -> Task RemObjects.EBuild.CleanSolution started.
1>		      -> Project consoleapplication1 started.
1>		         -> Task RemObjects.EBuild.Elements.ElementsCleanProject started for consoleapplication1.
1>		            -> Task RemObjects.EBuild.CleanProject started for consoleapplication1.
1>		            <- Task RemObjects.EBuild.CleanProject finished for consoleapplication1, took 0,0080s (0.008s).
1>		         <- Task RemObjects.EBuild.Elements.ElementsCleanProject finished for consoleapplication1, took 0,0000s (0.016s).
1>		      <- Project consoleapplication1 finished, took 0.016s.
1>		      Project 'consoleapplication1' cleaned successfully.
1>		      Solution 'consoleapplication1' cleaned successfully.
1>		   <- Task RemObjects.EBuild.CleanSolution finished for consoleapplication1, took 0,0339s (0.036s).
1>		   -> Task RemObjects.EBuild.BuildSolution started for consoleapplication1.
1>		      -> Project consoleapplication1 started.
1>		         -- Task RemObjects.EBuild.Elements.ElementsProjectPreBuildTask skipped for consoleapplication1, condition not met.
1>		         -> Task RemObjects.EBuild.Elements.ElementsBuildProject started for consoleapplication1.
1>		            -> Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths started for consoleapplication1.
1>		            <- Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths finished for consoleapplication1, took 0,0070s (0.008s).
1>		            -> Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings started for consoleapplication1, Cooper.
1>		               Mapping AssemblyName=consoleapplication1 to BinaryName in Target Cooper
1>		            <- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings finished for consoleapplication1, Cooper, took 0,0030s (0.002s).
1>		            -> Task RemObjects.EBuild.Elements.ElementsSanityCheck started for consoleapplication1, Cooper.
1>		            <- Task RemObjects.EBuild.Elements.ElementsSanityCheck finished for consoleapplication1, Cooper, took 0,0020s (0.002s).
1>		            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for consoleapplication1.
1>		               Preparing target 'Cooper' (platform 'Cooper').
1>		D:             Target-specific Settings, before prepare
1>		D:               - <BinaryName = consoleapplication1 [Target: Cooper]>
1>		D:               - <Mode = Cooper [Target: Cooper]>
1>		D:               - <SubMode = Plain [Target: Cooper]>
1>		               -> Task RemObjects.EBuild.Elements.ElementsPreflightCooper started for consoleapplication1.
1>		                  JDK found in 'C:\Program Files\AdoptOpenJDK\jdk-11.0.9.101-hotspot'.
1>		                  Libraries found in 'C:\Program Files\AdoptOpenJDK\jre-11.0.9.101-hotspot\lib'.
1>		                  Java executable found at 'C:\Program Files\AdoptOpenJDK\jre-11.0.9.101-hotspot\bin\java.exe'.
1>		               <- Task RemObjects.EBuild.Elements.ElementsPreflightCooper finished for consoleapplication1, took 0,0090s (0.009s).
1>		               -> Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform started for consoleapplication1, Cooper.
1>		               <- Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform finished for consoleapplication1, Cooper, took 0,0070s (0.017s).
1>		               -- Task RemObjects.EBuild.Elements.ElementsPrepareCooperAndroidPlatform skipped for consoleapplication1, Cooper, condition not met.
1>		D:             Target-specific Settings, after prepare
1>		D:               - <AarCacheFolder = C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\94CB8C1D933E8C9ACE121D7F4736D6F819A5CF92\Debug\Cooper\aar [Target: Cooper]>
1>		D:               - <BinaryName = consoleapplication1 [Target: Cooper]>
1>		D:               - <Mode = Cooper [Target: Cooper]>
1>		D:               - <SubMode = Plain [Target: Cooper]>
1>		            <- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms finished for consoleapplication1, took 0,0229s (0.024s).
1>		            -> Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles started for consoleapplication1, Cooper.
1>		            <- Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles finished for consoleapplication1, Cooper, took 0,0070s (0.007s).
1>		            -- Task RemObjects.EBuild.Elements.ElementsResolveHeaderImportFiles skipped for consoleapplication1, Cooper, condition not met.
1>		            -> Task RemObjects.EBuild.Elements.ElementsPreCompile started for consoleapplication1, Cooper.
1>		               -- Task RemObjects.EBuild.Elements.ElementsPreCompileEchoes skipped for consoleapplication1, Cooper, condition not met.
1>		               -- Task RemObjects.EBuild.Elements.ElementsPreCompileToffee skipped for consoleapplication1, Cooper, condition not met.
1>		               -> Task RemObjects.EBuild.Elements.ElementsPreCompileCooper started for consoleapplication1, Cooper.
1>		               <- Task RemObjects.EBuild.Elements.ElementsPreCompileCooper finished for consoleapplication1, Cooper, took 0,0000s (0.000s).
1>		               -- Task RemObjects.EBuild.Elements.ElementsPreCompileIsland skipped for consoleapplication1, Cooper, condition not met.
1>		            <- Task RemObjects.EBuild.Elements.ElementsPreCompile finished for consoleapplication1, Cooper, took 0,0000s (0.036s).
1>		            -- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings skipped for consoleapplication1, Cooper, already ran.
1>		            -- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms skipped for consoleapplication1, already ran.
1>		            -> Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences started for consoleapplication1.
1>		            <- Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences finished for consoleapplication1, took 0,0010s (0.001s).
1>		            -> Task RemObjects.EBuild.Elements.ElementsResolveReferences started for consoleapplication1.
1>		               -> Target Cooper started.
1>		                  -> Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget started for consoleapplication1, Cooper.
1>		                     -- Task RemObjects.EBuild.Elements.ElementsProcessGradleReferences skipped for consoleapplication1, Cooper, condition not met.
1>		E:                   Reference 'rt' could not be resolved for target 'Cooper' (Cooper Plain jvm).
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\RemObjects Software\Elements\RemObjects.Elements.Cooper.targets(70,3): error : Reference 'rt' could not be resolved for target 'Cooper' (Cooper Plain jvm).
1>		                     Reference 'cooper' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar' via XML for target 'Cooper'.
1>		                  <- Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget failed for consoleapplication1, Cooper, took 0,0459s (0.045s).
1>		               <- Target Cooper failed.
1>		            <- Task RemObjects.EBuild.Elements.ElementsResolveReferences failed for consoleapplication1, took 0,0588s (0.060s).
1>		         <- Task RemObjects.EBuild.Elements.ElementsBuildProject failed for consoleapplication1, took 0,0000s (0.116s).
1>		      <- Project consoleapplication1 failed, took 0.116s.
1>		      Project 'consoleapplication1' failed to build.
1>		      Solution 'consoleapplication1' failed to build project 'consoleapplication1'.
1>		   <- Task RemObjects.EBuild.BuildSolution failed for consoleapplication1, took 0,1234s (0.123s).
1>		Output Item(s): FinalOutput=
1>		Output Item(s): FinalOutputForReferencing=
1>Done building project "consoleapplication1.elements" -- FAILED.
1>
1>Build FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

As far as I recall this should be handled, but I’'ll have another look.

I’ve just downloaded the very latest OpenJDK I(15), and a new Java project builds fine for me after setting the path to it. key parts from the log:

D:             Target-specific Settings, before prepare
D:               - <Mode = Cooper [Target: Cooper]>
D:               - <SubMode = Plain [Target: Cooper]>
               -> Task RemObjects.EBuild.Elements.ElementsPreflightCooper started for consoleapplication64.
                  JDK found in '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home'.
                  Libraries found in '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home/jmods'.
                  Java executable found at '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home/bin/java'.
                  -> Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget started for consoleapplication64, Cooper.
                     -- Task RemObjects.EBuild.Elements.ElementsProcessGradleReferences skipped for consoleapplication64, Cooper, condition not met.
                     Reference 'rt' was resolved to '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home/jmods/java.base.jmod' for target 'Cooper'.
                     Reference 'cooper' was resolved to '/Users/mh/Code/Elements/Bin/References/Cooper/cooper.jar' via XML for target 'Cooper'.
                     Reference 'elements' was resolved to '/Users/mh/Code/Elements/Bin/References/Cooper/elements.jar' via XML for target 'Cooper'.
                  <- Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget finished for consoleapplication64, Cooper, took 0.0779s (0.082s).
                  -- Task ProcessAarReferences skipped for consoleapplication64, Cooper, condition not met.
      <- Project consoleapplication64 finished, took 9.540s.
      Project 'consoleapplication64' built successfully.
      Solution 'consoleapplication64' built successfully.
   <- Task RemObjects.EBuild.BuildSolution finished for consoleapplication64, took 9.6193s (9.627s).

I believe its been like this since Java 9 — using .jmods instead of the ,jar files; and since its worked back when I updated this and still works with 15, I have a hard time believing 11 is any different.

what could I be missing? Do you a have a jmods subfolder for in your JDK path?

Can you build your project from the command line Wirth ebuild --rebuild --debug and send me the full log? thanx!

Yes, jmods dir is there. I also tried OpenJDK 15 (which also has jmods), with the same results. Obviously, something is wrong with my settings or software setup.

So let’s see first how to properly setup java directories. My current setup is as follows:

The instructions there (highlighted) are not really helpful because they refer to a non-existing rt.jar file. So, is this setting correct? Do I need to setup anything else?

This setting yields the log:

[D:\RemObjects\consoleapplication2] ebuild --rebuild --debug
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2021. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2587 (develop) built on bajor, 20210101-113311. Commit 026cf1d.

   -> Task RemObjects.EBuild.CleanSolution started.
      -> Project consoleapplication2 started.
         -> Task RemObjects.EBuild.Elements.ElementsCleanProject started for consoleapplication2.
            -> Task RemObjects.EBuild.CleanProject started for consoleapplication2.
            <- Task RemObjects.EBuild.CleanProject finished for consoleapplication2, took 0,0010s (0.001s).
         <- Task RemObjects.EBuild.Elements.ElementsCleanProject finished for consoleapplication2, took 0,0000s (0.007s).
      <- Project consoleapplication2 finished, took 0.007s.
      Project 'consoleapplication2' cleaned successfully.
      Solution 'consoleapplication2' cleaned successfully.
   <- Task RemObjects.EBuild.CleanSolution finished for consoleapplication2, took 0,0127s (0.012s).
   -> Task RemObjects.EBuild.BuildSolution started for consoleapplication2.
      -> Project consoleapplication2 started.
         -- Task RemObjects.EBuild.Elements.ElementsProjectPreBuildTask skipped for consoleapplication2, condition not met.
         -> Task RemObjects.EBuild.Elements.ElementsBuildProject started for consoleapplication2.
            -> Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths started for consoleapplication2.
            <- Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths finished for consoleapplication2, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings started for consoleapplication2, Cooper.
               Mapping AssemblyName=consoleapplication2 to BinaryName in Target Cooper
            <- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings finished for consoleapplication2, Cooper, took 0,0014s (0.001s).
            -> Task RemObjects.EBuild.Elements.ElementsSanityCheck started for consoleapplication2, Cooper.
            <- Task RemObjects.EBuild.Elements.ElementsSanityCheck finished for consoleapplication2, Cooper, took 0,0000s (0.001s).
            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for consoleapplication2.
               Preparing target 'Cooper' (platform 'Cooper').
D:             Target-specific Settings, before prepare
D:               - <BinaryName = consoleapplication2 [Target: Cooper]>
D:               - <Mode = Cooper [Target: Cooper]>
D:               - <SubMode = Plain [Target: Cooper]>
               -> Task RemObjects.EBuild.Elements.ElementsPreflightCooper started for consoleapplication2.
                  JDK found in 'D:\Tmp\jdk-15.0.1'.
                  Libraries found in 'D:\Tmp\jdk-15.0.1\lib'.
                  Java executable found at 'D:\Tmp\jdk-15.0.1\bin\java.exe'.
               <- Task RemObjects.EBuild.Elements.ElementsPreflightCooper finished for consoleapplication2, took 0,0027s (0.002s).
               -> Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform started for consoleapplication2, Cooper.
               <- Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform finished for consoleapplication2, Cooper, took 0,0070s (0.009s).
               -- Task RemObjects.EBuild.Elements.ElementsPrepareCooperAndroidPlatform skipped for consoleapplication2, Cooper, condition not met.
D:             Target-specific Settings, after prepare
D:               - <AarCacheFolder = C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\aar [Target: Cooper]>
D:               - <BinaryName = consoleapplication2 [Target: Cooper]>
D:               - <Mode = Cooper [Target: Cooper]>
D:               - <SubMode = Plain [Target: Cooper]>
            <- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms finished for consoleapplication2, took 0,0164s (0.018s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles started for consoleapplication2, Cooper.
            <- Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles finished for consoleapplication2, Cooper, took 0,0020s (0.002s).
            -- Task RemObjects.EBuild.Elements.ElementsResolveHeaderImportFiles skipped for consoleapplication2, Cooper, condition not met.
            -> Task RemObjects.EBuild.Elements.ElementsPreCompile started for consoleapplication2, Cooper.
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileEchoes skipped for consoleapplication2, Cooper, condition not met.
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileToffee skipped for consoleapplication2, Cooper, condition not met.
               -> Task RemObjects.EBuild.Elements.ElementsPreCompileCooper started for consoleapplication2, Cooper.
               <- Task RemObjects.EBuild.Elements.ElementsPreCompileCooper finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileIsland skipped for consoleapplication2, Cooper, condition not met.
            <- Task RemObjects.EBuild.Elements.ElementsPreCompile finished for consoleapplication2, Cooper, took 0,0000s (0.025s).
            -- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings skipped for consoleapplication2, Cooper, already ran.
            -- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms skipped for consoleapplication2, already ran.
            -> Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences started for consoleapplication2.
            <- Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences finished for consoleapplication2, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveReferences started for consoleapplication2.
               -> Target Cooper started.
                  -> Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget started for consoleapplication2, Cooper.
                     -- Task RemObjects.EBuild.Elements.ElementsProcessGradleReferences skipped for consoleapplication2, Cooper, condition not met.
E:                   Reference 'rt' could not be resolved for target 'Cooper' (Cooper Plain jvm).
                     Reference 'cooper' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar' via XML for target 'Cooper'.
                  <- Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget failed for consoleapplication2, Cooper, took 0,0076s (0.007s).
               <- Target Cooper failed.
            <- Task RemObjects.EBuild.Elements.ElementsResolveReferences failed for consoleapplication2, took 0,0112s (0.016s).
         <- Task RemObjects.EBuild.Elements.ElementsBuildProject failed for consoleapplication2, took 0,0000s (0.050s).
      <- Project consoleapplication2 failed, took 0.054s.
      Project 'consoleapplication2' failed to build.
      Solution 'consoleapplication2' failed to build project 'consoleapplication2'.
   <- Task RemObjects.EBuild.BuildSolution failed for consoleapplication2, took 0,0570s (0.057s).

Yeah, those instructions still reflect Java 8; I’ll log an issue to get hat updated. if that folder contains ./jmods, then it should be correct.

Note that when I downloaded the OpenJDK here, I needed to specify a subfolder of where it extracted too, /Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home, not just /Users/mh/Downloads/jdk-15.0.1.jdk/. But that may be different between Mac and Windows; I will test this myself own Windows in a short bit.

                 JDK found in 'D:\Tmp\jdk-15.0.1'.
                  Libraries found in 'D:\Tmp\jdk-15.0.1\lib'.
                  Java executable found at 'D:\Tmp\jdk-15.0.1\bin\java.exe'.

curious, for me this gives

                  JDK found in '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home'.
                  Libraries found in '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home/jmods'.
                  Java executable found at '/Users/mh/Downloads/jdk-15.0.1.jdk/Contents/Home/bin/java'.

note that it detects ./jmods, while for you it detects ./lib — that is the problem; now to find out why…


So I downloaded the Windows versions of the JDK, just to see if it has a different structure that messes tings up, but with that, it still works, here for me: (it doesn’t ding the java executable, ofc, but that doesnt matter).

                  JDK found in '/Users/mh/Downloads/jdk-15.0.1-win'.
                  Libraries found in '/Users/mh/Downloads/jdk-15.0.1-win/jmods'.
                  Java executable found at ''.

Same on Windows; looks fine

                  JDK found in '\\Mac\Home\Downloads\jdk-15.0.1-win'.
                  Libraries found in '\\Mac\Home\Downloads\jdk-15.0.1-win\jmods'.
                  Java executable found at '\\Mac\Home\Downloads\jdk-15.0.1-win\bin\java.exe'.

What I’ll do next is dry-review the code that detects tis to see what could go wring and then (barring any insight) create a small test app with some extra logging that hopefully you can run locally to help see where its going wrong…

Oh, I see whats going on. you have JRE path set to a folder that exists, but it NOT the JRE path, but does contain lib. So the logic ends up in Java 7 mode, using jre/lib as library folder. Java 9+ dent have a JRE folder any more; the fix is to clear that setting, and only set the JDK.

I’ll see if I can somehow detect this and recover, but essentially, this is configured wrong :wink:

let me know if cleaning that helps; if not we need to investigate further…

Clearing the Java runtime path did help; I did get a running Java console application, finally. But I don’t think it has been configured correctly.

After clearing the JRE path, the Option dialog looks as follows:

See the implied path to jre 1.8.0_271?

EBuild clearly uses this implicit setting, saying:

Reference 'rt' was resolved to 'C:\Program Files (x86)\Java\jre1.8.0_271\lib\rt.jar' for target 'Cooper'.

I don’t think this is correct.

Also notice that I have setJAVA_HOME=D:\Tmp\jdk-15.0.1 and %JAVA_HOME%/bin is the first entry in the PATH. So that:

[D:\RemObjects\consoleapplication2] java -version
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+9-18)
OpenJDK 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

The new full EBuild log:

RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2021. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2587 (develop) built on bajor, 20210101-113311. Commit 026cf1d.

   -> Task RemObjects.EBuild.CleanSolution started.
      -> Project consoleapplication2 started.
         -> Task RemObjects.EBuild.Elements.ElementsCleanProject started for consoleapplication2.
            -> Task RemObjects.EBuild.CleanProject started for consoleapplication2.
               Deleted 'D:\RemObjects\consoleapplication2\Bin\Release\consoleapplication2.jar'
               Deleted 'D:\RemObjects\consoleapplication2\Bin\Release\cooper.jar'
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\Cleanup.cache
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\consoleapplication2.jar
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\consoleapplication2.publichash
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\Caches\CoreCompile.cache
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\Caches\CoreCompile.messages.cache
               Deleted C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\Caches\ResolveReferences.cache
            <- Task RemObjects.EBuild.CleanProject finished for consoleapplication2, took 0,0041s (0.004s).
         <- Task RemObjects.EBuild.Elements.ElementsCleanProject finished for consoleapplication2, took 0,0000s (0.008s).
      <- Project consoleapplication2 finished, took 0.008s.
      Project 'consoleapplication2' cleaned successfully.
      Solution 'consoleapplication2' cleaned successfully.
   <- Task RemObjects.EBuild.CleanSolution finished for consoleapplication2, took 0,0100s (0.010s).
   -> Task RemObjects.EBuild.BuildSolution started for consoleapplication2.
      -> Project consoleapplication2 started.
         -- Task RemObjects.EBuild.Elements.ElementsProjectPreBuildTask skipped for consoleapplication2, condition not met.
         -> Task RemObjects.EBuild.Elements.ElementsBuildProject started for consoleapplication2.
            -> Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths started for consoleapplication2.
            <- Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths finished for consoleapplication2, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings started for consoleapplication2, Cooper.
               Mapping AssemblyName=consoleapplication2 to BinaryName in Target Cooper
            <- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsSanityCheck started for consoleapplication2, Cooper.
            <- Task RemObjects.EBuild.Elements.ElementsSanityCheck finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for consoleapplication2.
               Preparing target 'Cooper' (platform 'Cooper').
D:             Target-specific Settings, before prepare
D:               - <BinaryName = consoleapplication2 [Target: Cooper]>
D:               - <Mode = Cooper [Target: Cooper]>
D:               - <SubMode = Plain [Target: Cooper]>
               -> Task RemObjects.EBuild.Elements.ElementsPreflightCooper started for consoleapplication2.
                  JDK found in 'D:\Tmp\jdk-15.0.1'.
                  Libraries found in 'C:\Program Files (x86)\Java\jre1.8.0_271\lib'.
                  Java executable found at 'C:\Program Files (x86)\Java\jre1.8.0_271\bin\java.exe'.
               <- Task RemObjects.EBuild.Elements.ElementsPreflightCooper finished for consoleapplication2, took 0,0020s (0.001s).
               -> Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform started for consoleapplication2, Cooper.
               <- Task RemObjects.EBuild.Elements.ElementsPrepareCooperPlatform finished for consoleapplication2, Cooper, took 0,0070s (0.008s).
               -- Task RemObjects.EBuild.Elements.ElementsPrepareCooperAndroidPlatform skipped for consoleapplication2, Cooper, condition not met.
D:             Target-specific Settings, after prepare
D:               - <AarCacheFolder = C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\aar [Target: Cooper]>
D:               - <BinaryName = consoleapplication2 [Target: Cooper]>
D:               - <Mode = Cooper [Target: Cooper]>
D:               - <SubMode = Plain [Target: Cooper]>
            <- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms finished for consoleapplication2, took 0,0090s (0.008s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles started for consoleapplication2, Cooper.
            <- Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles finished for consoleapplication2, Cooper, took 0,0020s (0.001s).
            -- Task RemObjects.EBuild.Elements.ElementsResolveHeaderImportFiles skipped for consoleapplication2, Cooper, condition not met.
            -> Task RemObjects.EBuild.Elements.ElementsPreCompile started for consoleapplication2, Cooper.
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileEchoes skipped for consoleapplication2, Cooper, condition not met.
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileToffee skipped for consoleapplication2, Cooper, condition not met.
               -> Task RemObjects.EBuild.Elements.ElementsPreCompileCooper started for consoleapplication2, Cooper.
               <- Task RemObjects.EBuild.Elements.ElementsPreCompileCooper finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
               -- Task RemObjects.EBuild.Elements.ElementsPreCompileIsland skipped for consoleapplication2, Cooper, condition not met.
            <- Task RemObjects.EBuild.Elements.ElementsPreCompile finished for consoleapplication2, Cooper, took 0,0000s (0.010s).
            -- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings skipped for consoleapplication2, Cooper, already ran.
            -- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms skipped for consoleapplication2, already ran.
            -> Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences started for consoleapplication2.
            <- Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences finished for consoleapplication2, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveReferences started for consoleapplication2.
               -> Target Cooper started.
                  -> Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget started for consoleapplication2, Cooper.
                     -- Task RemObjects.EBuild.Elements.ElementsProcessGradleReferences skipped for consoleapplication2, Cooper, condition not met.
                     Reference 'rt' was resolved to 'C:\Program Files (x86)\Java\jre1.8.0_271\lib\rt.jar' for target 'Cooper'.
                     Reference 'cooper' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar' via XML for target 'Cooper'.
                  <- Task RemObjects.EBuild.Elements.ElementsResolveCooperReferencesForTarget finished for consoleapplication2, Cooper, took 0,0040s (0.003s).
                  -- Task ProcessAarReferences skipped for consoleapplication2, Cooper, condition not met.
               <- Target Cooper finished.
            <- Task RemObjects.EBuild.Elements.ElementsResolveReferences finished for consoleapplication2, took 0,0194s (0.020s).
            -> Task RemObjects.EBuild.Elements.ElementsPreCompile2 started for consoleapplication2, Cooper.
               -- Task RemObjects.EBuild.Elements.ElementsRunGenerators skipped for consoleapplication2, Cooper, condition not met.
               -- Task RemObjects.EBuild.Elements.ElementsPreCompile2Echoes skipped for consoleapplication2, Cooper, condition not met.
               -> Task RemObjects.EBuild.Elements.ElementsPreCompile2Cooper started for consoleapplication2, Cooper.
                  -- Task Predex skipped for consoleapplication2, Cooper, condition not met.
                  -- Task RemObjects.EBuild.Elements.ElementsCooperProcessResources skipped for consoleapplication2, Cooper, condition not met.
                  -- Task ProcessManifest skipped for consoleapplication2, Cooper, condition not met.
                  -- Task ProcessResources skipped for consoleapplication2, Cooper, condition not met.
               <- Task RemObjects.EBuild.Elements.ElementsPreCompile2Cooper finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            <- Task RemObjects.EBuild.Elements.ElementsPreCompile2 finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            -> Task Compile started for consoleapplication2.
D:             Loading compiler from 'C:\Program Files (x86)\RemObjects Software\Elements\bin\RemObjects.Elements.dll'
               Compiling target 'Cooper'
               -> Target Cooper started compiling.
                  Starting compile for consoleapplication2 Cooper 
                  RemObjects Elements Compiler for .NET, Cocoa, Java and Island.
                  Copyright 2003-2021 RemObjects Software, LLC. All rights reserved. Created by Carlo Kok
                  Version 10.0.0.2587 (develop) built on bajor, 20210101-113311. Commit 026cf1d.
                  Source file: D:\RemObjects\consoleapplication2\Program.pas
                  Reference: C:\Program Files (x86)\Java\jre1.8.0_271\lib\rt.jar
                  Reference: C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar
                  -> Phase Resolving Bodies started.
W:                   Case for identifier "readln" does not match original case "readLn" [D:\RemObjects\consoleapplication2\Program.pas (14)]
                  <- Phase Resolving Bodies finished, took 2.097s.
                  -> Phase Checking Members started.
                  <- Phase Checking Members finished, took 0.061s.
                  -> Phase Generating Helper Types started.
                  <- Phase Generating Helper Types finished, took 0.091s.
                  -> Phase Inlining Code started.
                  <- Phase Inlining Code finished, took 0.015s.
                  -> Phase Pre-Simplifying Code started.
                  <- Phase Pre-Simplifying Code finished, took 0.000s.
                  -> Phase Simplifying Code started.
                  <- Phase Simplifying Code finished, took 0.051s.
                  -> Phase Flow Analysis started.
                  <- Phase Flow Analysis finished, took 0.027s.
                  -> Phase Generating Output started.
                  <- Phase Generating Output finished, took 0.158s.
               <- Target Cooper finished compiling.
D:             CompilerOutput for Cooper
D:               - <CompilerOutput: C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\consoleapplication2.jar [Target: Cooper]>
            <- Task Compile finished for consoleapplication2, took 3,3553s (3.386s).
            -> Task RemObjects.EBuild.Elements.ElementsPostCompile started for consoleapplication2, Cooper.
               -- Task RemObjects.EBuild.Elements.ElementsPostCompileEchoes skipped for consoleapplication2, Cooper, condition not met.
               -- Task RemObjects.EBuild.Elements.ElementsPostCompileToffee skipped for consoleapplication2, Cooper, condition not met.
               -> Task RemObjects.EBuild.Elements.ElementsPostCompileCooper started for consoleapplication2, Cooper.
                  -- Task AndroidPack skipped for consoleapplication2, Cooper, condition not met.
                  -- Task CodeSign skipped for consoleapplication2, Cooper, condition not met.
               <- Task RemObjects.EBuild.Elements.ElementsPostCompileCooper finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
               -- Task RemObjects.EBuild.Elements.ElementsPostCompileIsland skipped for consoleapplication2, Cooper, condition not met.
            <- Task RemObjects.EBuild.Elements.ElementsPostCompile finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsLink started for consoleapplication2.
            <- Task RemObjects.EBuild.Elements.ElementsLink finished for consoleapplication2, took 0,0000s (3.386s).
            -> Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutput started for consoleapplication2.
               -> Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutputCooper started for consoleapplication2, Cooper.
               <- Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutputCooper finished for consoleapplication2, Cooper, took 0,0000s (0.000s).
            <- Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutput finished for consoleapplication2, took 0,0000s (3.386s).
            -> Task RemObjects.EBuild.Elements.ElementsCopyFinalOutput started for consoleapplication2.
D:             Copying to D:\RemObjects\consoleapplication2\Bin\Release
D:             Generated Files for 'consoleapplication2' target 'Cooper':
D:               consoleapplication2.jar (C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\consoleapplication2.jar)
D:               cooper.jar (C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar)
               Final Output for 'consoleapplication2' target 'Cooper':
                 consoleapplication2.jar (D:\RemObjects\consoleapplication2\Bin\Release\consoleapplication2.jar)
                 cooper.jar (D:\RemObjects\consoleapplication2\Bin\Release\cooper.jar)
               Final Output for Referencing:
                 consoleapplication2 (C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\Cooper\consoleapplication2.jar), Cooper
                 cooper (C:\Program Files (x86)\RemObjects Software\Elements\References\Cooper\cooper.jar), Cooper
I:             FINALOUTPUT C:\Users\mare\AppData\Local\RemObjects Software\EBuild\Obj\199CC03AE06B8C83A833D98F3C8483166096FB57\Release\FinalOutput.xml
            <- Task RemObjects.EBuild.Elements.ElementsCopyFinalOutput finished for consoleapplication2, took 0,0110s (3.398s).
         <- Task RemObjects.EBuild.Elements.ElementsBuildProject finished for consoleapplication2, took 0,0000s (3.398s).
         -- Task RemObjects.EBuild.Elements.ElementsProjectPostBuildTask skipped for consoleapplication2, condition not met.
      <- Project consoleapplication2 finished, took 3.398s.
      Project 'consoleapplication2' built successfully.
      Solution 'consoleapplication2' built successfully.
   <- Task RemObjects.EBuild.BuildSolution finished for consoleapplication2, took 3,3997s (3.399s).

Hmm, yeah. It still detects the default Java 8 JRE folder, for some reason. Do you need Java 8 or can you uninstall it (as the Java updater recommends)? Uninstalling it should fix this.

Regardless, I’ll investigate what’s going on here and how/if I can prevent/detect a mismatch here.

—marc

Hmm, I can’t quite understand how it would find that JRE folder; the only places I look for for the JRE are in the settings, and underneath the JDK.

Can you do me a favor and run this project and give me the output?

I get

The magic happens here.
fJDKFolder /Users/mh/Downloads/jdk-15.0.1-win
GetPath(sJRE) /Users/mh/Downloads/jdk-15.0.1-win
looking for JRE from undernweath JDK: 
final JREFolder 
Libraries found in '/Users/mh/Downloads/jdk-15.0.1-win/jmods'.

note how cant find a JRE anywhere (good).

Archive.zip (1.4 MB)

Settings:
JRE path: C:\Program Files (x86)\Java\jre1.8.0_271 (cleared & implied)
JDK path: D:\Tmp\jdk-15.0.1

[D:\Tmp\0] EBuild.Playground.exe
The magic happens here.
fJDKFolder D:\Tmp\jdk-15.0.1
GetPath(sJRE) C:\Program Files (x86)\Java\jre1.8.0_271
JRE from setting
final JREFolder: C:\Program Files (x86)\Java\jre1.8.0_271
Libraries found in 'C:\Program Files (x86)\Java\jre1.8.0_271\lib'.

It is curious that the same result is obtained even after "C:\Program Files (x86)\Java\jre1.8.0_271" is renamed to something else (as a simulation of java 8 removal). There must be some hidden setting or link somewhere.

At all times, JAVA_HOME points to D:\Tmp\jdk-15.0.1

This means you still have the JRE path hardcoded (despite what VS might how).

If you open Water and to to Tools|Options|Paths, what does it show? also, open %APPDATA%\RemObhects Software\Elements\CooperPaths.xml in a text editor — dies it java the JRE set? is so, can you remove it?

Yes, JRE was in CooperPaths.xml, and deleting it did help. Creating a new Java app works nicely now, so the problem seems solved.

Marc, thank you very much, I appreciate your help. I am glad I learned something new.

Excellent happy to hear!

I had similar problem, fortunetly your advices fixed them.
But now i encountered another one. Oxygene cant see javax.sing or java.awt neither java.beans.

Can I get an example project that shows this? I’m not familiar with those APIs, but I assume they come with the JDK and the respective jmod files re present in thej mods folder?

The same happens to other uses like java.awt for example.

image