Can't get a Swift program to run with Fire

When I tried to run the following program within Fire:

import java.util

println("The magic happens here.")

I got the following errors:


mono /Users/me/Downloads/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /Users/me/Documents/consoleapplication/consoleapplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug "/property:ElementsXbuildNougatSDKFolder=/Users/me/Downloads/Fire.app/Contents/Resources/Nougat SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Users/me/Downloads/Fire.app/Contents/Resources/Reference Paths" /toolsversion:4.0

__________________________________________________
Project "/Users/me/Documents/consoleapplication/consoleapplication.sln" (Build target(s)):
        Target ValidateSolutionConfiguration:
                Building solution configuration "Debug|AnyCPU".
        Target Build:
                Project "/Users/me/Documents/consoleapplication/consoleapplication.elements" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Debug Platform: AnyCPU
                        Target GetReferenceAssemblyPaths:
/Users/me/Downloads/Fire.app/Contents/Resources/Mono/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v4.0'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.
                        Target CooperPreflight:
/Users/me/Downloads/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Common.targets: error : Error checking Java base paths: Argument cannot be null.
Parameter name: path1
Parameter name: path1
                        Task "JavaBuildPreflight" execution -- FAILED
                        Done building target "CooperPreflight" in project "/Users/me/Documents/consoleapplication/consoleapplication.elements".-- FAILED
                Done building project "/Users/me/Documents/consoleapplication/consoleapplication.elements".-- FAILED
        Task "MSBuild" execution -- FAILED
        Done building target "Build" in project "/Users/me/Documents/consoleapplication/consoleapplication.sln".-- FAILED
Done building project "/Users/me/Documents/consoleapplication/consoleapplication.sln".-- FAILED

Build FAILED.

Warnings:

/Users/me/Documents/consoleapplication/consoleapplication.sln (Build) ->
(Build target) ->
/Users/me/Documents/consoleapplication/consoleapplication.elements (default targets) ->
/Users/me/Downloads/Fire.app/Contents/Resources/Mono/lib/mono/4.5/Microsoft.Common.targets (GetReferenceAssemblyPaths target) ->

        /Users/me/Downloads/Fire.app/Contents/Resources/Mono/lib/mono/4.5/Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v4.0'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

Errors:

/Users/me/Documents/consoleapplication/consoleapplication.sln (Build) ->
(Build target) ->
/Users/me/Documents/consoleapplication/consoleapplication.elements (default targets) ->
/Users/me/Downloads/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Common.targets (CooperPreflight target) ->

        /Users/me/Downloads/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Common.targets: error : Error checking Java base paths: Argument cannot be null.
Parameter name: path1

         1 Warning(s)
         1 Error(s)

Any clues why? I’m using the latest beta of Fire on OS X Mavericks.

Do you have any paths for Java or Android SDKs set in Fire preferences? If not, do you have the Java and Android SDKs installed,and do their default paths show as grayed-but detected-ok in Fire Preferences? Do yu have a ~/Library/Application Support/RemObjects Software/Elements/CooperPaths.xml file, and if so can you post it here?

See http://docs.elementscompiler.com/Fire/Setup/ for details this.

(Mind you, the error you ar getting is a bug, regardless. i’m just trying to narrow it down why it happens.)

Nevermind, we found the issue,and the next build, later tonight, will have this fixed.

That said, the underlying root issue is that yo don’t have Java installed. Just running “java” from the command line should fix that. Or (better) download the Java 8.0 JDK installer from Oracle. The next build will give a proper error message for that, as it should have.

thanx for reporting!

—marc

Fire seems to have a bug in finding the JRE folder:

I have fixed the problem by installing JDK 8.

1 Like

Yeah, the bug wasn’t so much in finding the folder, as in handling the case when it can’t be found. I can confirm that the is now fixed,for the next build.

—marc