Setting JRERoot on a command line build

Hi, I’m trying to get a command line build going on a Debian Linux box, using xbuild and the elements linux install.

I’m getting this error:

JDKRoot:/usr
JRERoot:
: Pre-Flight error CP1: No installation of the Java SDK (JDK) and the Java Runtime Environment (JRE) has been found. The JDK is needed to successfully open and build Oxygene projects for Java. You can visit https://docs.elementscompiler.com/VisualStudio/Setup/ to download and install the JDK. If you have a copy of the JDK installed on your system in a non-standard location, you can also manually configure the path in the IDE options.

How do you tell xbuild the value of JDKRoot / JRERoot ?
Setting JAVA_HOME or JRERoot environment var seems to have no effect, and I couldn’t get a property to work (like “/property:JRERoot=/usr/lib/jvm/java-7-openjdk-amd64/jre” )

Create a file called ~/.elements/CooperPaths.xml, inside it something like:

<config>
  <jre>/path/to/jre</jre>
  <jdk>...</jdk>
  <androidsdk>...</androidsdk>
</config>

Works great, thanks!

I’m having one more issue. On my project the output jar stays in obj/Debug/Android , and isnt copied into bin/Debug.

I started to work around this, but then hit the problem that another project in the solution references the jar from within the bin/Debug folder - eg has a hint to that location, and that means it can’t find it.

This is the output from a brand new test project, building by just running xbuild. Note the bit at the end where the jar is in obj, not bin.

This is on my debian build box, using the 8.3.2013 command line compiler. Am I missing something?

a@android-builds:~/git/SilverTest29$ xbuild
XBuild Engine Version 14.0
Mono, Version 4.4.0.0
Copyright (C) 2005-2013 Various Mono authors

Build started 14/07/2016 7:26:46 AM.
__________________________________________________
Project "/home/a/git/SilverTest29/SilverTest29.sln" (default target(s)):
	Target ValidateSolutionConfiguration:
		Building solution configuration "Debug|AnyCPU".
	Target Build:
		Project "/home/a/git/SilverTest29/SilverTest29.elements" (default target(s)):
			Target CooperPreflight:
				JDKRoot:/usr/lib/jvm/java-7-openjdk-amd64/
				JRERoot:/usr/lib/jvm/java-7-openjdk-amd64/jre
			Target PrepareForBuild:
				Configuration: Debug Platform: AnyCPU
				Created directory "obj/Debug/Android/"
			Target ResolveGradleReferences:
			No input files were specified for target ResolveGradleReferences, skipping.
			Target ResolveAssemblyReferences:
				Reference: android
				Reference: swift
				Reference: cooper
			Target PredexThings:
			No input files were specified for target PredexThings, skipping.
			Target GenerateSatelliteAssemblies:
			No input files were specified for target GenerateSatelliteAssemblies, skipping.
			Target CoreCompile:
				RemObjects Elements (Oxygene, C# and Silver) Compiler for .NET, Cocoa and Java.
				Version 8.3.94.2013 (beta) build on bajor, 20160701-132924. Commit 6f3c920.
				Copyright 2003-2016 RemObjects Software, LLC. All rights reserved.
				Source file: /home/a/git/SilverTest29/Program.swift
				Reference: /home/a/.android-sdk/platforms/android-23/android.jar
				Reference: /home/a/elements/References/Cooper/swift.jar
				Reference: /home/a/elements/References/Cooper/cooper.jar
				Entering phase "Loading Source Files" (00:00:00.3562764)
				Entering phase "Loading Resources" (00:00:00.1167597)
				Entering phase "Resolving Namespaces" (00:00:00.0008564)
				Entering phase "Resolving Types" (00:00:00.0142514)
				Entering phase "Resolving Properties and Events" (00:00:00.0953366)
				Entering phase "Resolving Interfaces" (00:00:00.0279203)
				Entering phase "Resolving Bodies" (00:00:00.0797816)
				Entering phase "Checking Members" (00:00:00.3148420)
				Entering phase "Generating Helper Types" (00:00:00.0275862)
				Entering phase "Inlining code" (00:00:00.0241955)
				Entering phase "Pre-Simplifying Code" (00:00:00.0053922)
				Entering phase "Simplifying Code" (00:00:00.0002351)
				Entering phase "Flow Analysis" (00:00:00.0166078)
				Entering phase "Generating Output" (00:00:00.0090987)
				Entering phase "Done" (00:00:00.1389791)
		Done building project "/home/a/git/SilverTest29/SilverTest29.elements".
Done building project "/home/a/git/SilverTest29/SilverTest29.sln".

Build succeeded.
	 0 Warning(s)
	 0 Error(s)

Time Elapsed 00:00:01.6953720

android-builds:~/git/SilverTest29$ ls bin/Debug/
cooper.jar  swift.jar

android-builds:~/git/SilverTest29$ ls obj/Debug/Android/
SilverTest29.elements.FilesWrittenAbsolute.txt  silvertest29.jar

a@android-builds:~/git/SilverTest29$ cat obj/Debug/Android/SilverTest29.elements.FilesWrittenAbsolute.txt 
/home/a/git/SilverTest29/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttribute.pas
/home/a/git/SilverTest29/bin/Debug/swift.jar
/home/a/git/SilverTest29/bin/Debug/cooper.jar

Turns out that this is somehow case related. Note the file in obj is silvertest29 but the project name is SilverTest29
When I specifically set the assembly name to lower case silvertest29 it gets copied across.

But is the .apk copied? The .apk is the “final deliverable”, not the .jar.

That does sound like a bug then, probably case-deities-filest stem, related. Java .jar flies are always lowercase, but the project name should not affect this (the AssemblyName setting in the project does). Can you sen d me the exact project that shows the problem? Was AssemblyName set to Uppercase or not set at all? IIs setting Assembly name properly what fixed the issue for you?

Thanx!

ok… 1. The jar was the output (it was a lib project)
2. Project name had capitals SilverTest29
3. Assembly name was not set
4. On OSX, which is not case sensitive, the jar that ended up in bin/Debug has captials, but the one in obj was lowercase
5. On linux, the obj/Android one was lower case, but never copied to bin/Debug
6. Setting the Assembly name to all lowercase fixed the issue (had to do this in the .elements file as Fire wouldnt let me set it to what it thought was the default)

So my assumption is that Assembly name is defaulting to the capitals version, but the compiler outputs in lowercase, and this is all fine except on a case sensitive system!