Untouched Griffon Module generated by IntelliJ raises exception before it loads?

IntelliJIDEA 12.1.3 Community Edition
Groovy Version: 2.1.3
JVM: 1.7.0_21 Vendor: Oracle Corporation OS: Windows 7
Griffon 1.3.0
Windows 7 64bit

New to IntelliJ, Groovy, Griffon, (and java mostly).

I create a new Griffon Module. I then try to run it but I get the following error:

    "C:\Program Files\Java\jdk1.7.0_21\bin\java" -Xmx256M
    -Dgriffon.home=C:\griffon-1.3.0 -Dbase.dir=C:\intellij\griffon1
    "-Dtools.jar=C:\Program Files\Java\jdk1.7.0_21\lib\tools.jar"
    "-Dgroovy.sanitized.stacktraces=\"groovy., org.codehaus.groovy., java.,
    javax., sun., gjdk.groovy., gant., org.codehaus.gant.\""
    -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Program Files
    (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1.3\bin"
    -Dfile.encoding=UTF-8 -classpath
    Files (x86)\JetBrains\IntelliJ IDEA Community Edition
    12.1.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain
    org.codehaus.griffon.cli.support.GriffonStarter --main
    org.codehaus.griffon.cli.GriffonScriptRunner --conf
    C:\griffon-1.3.0/conf/groovy-starter.conf run-app

    Welcome to Griffon 1.3.0 - http://griffon-framework.org/
    Licensed under Apache Standard License 2.0
    Griffon home is set to: C:\griffon-1.3.0

    Base Directory: C:\intellij\griffon1
    Running script C:\griffon-1.3.0\scripts\RunApp.groovy
    Resolving dependencies...
    Dependencies resolved in 330ms.
    Environment set to development
    Resolving framework plugin dependencies ...
    Framework plugin dependencies resolved in 479 ms.
    Resolving plugin dependencies ...
    Plugin dependencies resolved in 422 ms.
         [copy] Copying 1 file to C:\Users\<REDACTED>\.griffon\1.3.0\projects\griffon1\classes\main
    Launching application ...
       [delete] Deleting directory C:\intellij\griffon1\staging\windows64
    java.io.IOException: Cannot run program "C:\Program" (in directory "C:\intellij\griffon1\staging"): CreateProcess error=2, The system cannot find the file specified
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
            at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:732)
            at groovy.lang.GroovyObject$invokeMethod.callCurrent(Unknown Source)
            at org.codehaus.griffon.cli.GriffonScriptRunner.executeWithGantInstance(GriffonScriptRunner.java:648)
            at org.codehaus.griffon.cli.GriffonScriptRunner.executeWithGantInstanceNoException(GriffonScriptRunner.java:667)
            at org.codehaus.griffon.cli.GriffonScriptRunner.callPluginOrGriffonScript(GriffonScriptRunner.java:392)
            at org.codehaus.griffon.cli.GriffonScriptRunner.doExecuteCommand(GriffonScriptRunner.java:303)
            at org.codehaus.griffon.cli.GriffonScriptRunner.main(GriffonScriptRunner.java:141)
            at org.codehaus.griffon.cli.support.GriffonStarter.rootLoader(GriffonStarter.java:198)
            at org.codehaus.griffon.cli.support.GriffonStarter.main(GriffonStarter.java:223)
            at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

At first I thought it was because I also use the free TCC-LE (the replacement for 4NT) [1] as my standard cmd shell so my COMSPEC env variable looks like:

    ComSpec=C:\Program Files\JPSoft\TCCLE13x64\TCC.EXE

Some of the batch files for java related stuff I've been using in the last week (groovy for example but it seems like something else was doing it also), do %COMSPEC% instead of "%COMSPEC% so that was causing errors or annoying warning messages. I just edited the batch files to fix that.

When I came across this new error, I assumed it was the same problem. I tried looking around the source of griffon-griffon-1.3.0\subprojects\griffon-cli\src\main\groovy\org\codehaus\griffon\cli\support\GriffonStarter.java but couldn't figure out how to turn on the debugging mode it has by changing my Run Configuration.

Therefore, I resorted to uninstalling TCC-LE and re-installed it to a location without any embedded spaces. Unfortunately I still get the same exact error message.

So something is trying to launch a program in C:\Program Files but not taking into account the embedded space. How can I fix this?

[1] http://jpsoft.com/tccle-cmd-replacement.html

1 comment

I realized the same thing was happening from the command line. I therefore asked the same question on the user@griffon.codehaus.org mailing list.

The answer is this is a "well-known" (but undocumented!) problem with Griffon on Windows. You have to make sure not only Griffon but Java is not installed in the standard Program Files directory (or any directory with embedded spaces). Sheesh.

After looking at the mind boggling complexity of Griffon vs say the relatively simple C# + WPF + MVVMLight [1] or SimpleMVVM [2] implementation of similar ideas (at least as far as isolating user interfaces from direct knowledge of underlying models or "controllers" and vice versa), I've decided to not learn Griffon.

Instead I'll try the less pure approach mentioned in "UI Construction with JavaFX" [3] by Dierk König (even though that's where I saw that one should use Griffon instead if possible).

[1] http://www.galasoft.ch/mvvm/

[2] http://simplemvvmtoolkit.codeplex.com/

[3] http://www.canoo.com/blog/2012/02/12/ui-construction-with-javafx/

Please sign in to leave a comment.