[
https://issues.apache.org/jira/browse/GROOVY-7851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-7851.
-----------------------------
Resolution: Fixed
I think this was fixed a long time ago via other changes. I tried with Groovy
2.4.21 and Groovy 4.0.3:
{noformat}
> groovysh -cp commons-math3-3.6.1.jar
Groovy Shell (2.4.21, JVM: 1.8.0_282)
Type ':help' or ':h' for help.
-----------------------------------------------------------------------------------
groovy:000> import org.apache.commons.math3.fraction.*
===> org.apache.commons.math3.fraction.*
groovy:000> Fraction.FOUR_FIFTHS
===> 4 / 5
groovy:000> _.percentageValue()
===> 80.0
groovy:000> :q
{noformat}
> groovysh classpath switch not working under Windows
> ---------------------------------------------------
>
> Key: GROOVY-7851
> URL: https://issues.apache.org/jira/browse/GROOVY-7851
> Project: Groovy
> Issue Type: Bug
> Components: Groovysh
> Affects Versions: 2.4.6, 2.4.7
> Environment: Windows 7 64-bit, Windows 10 64-bit
> Reporter: David Eisner
> Priority: Major
> Labels: windows
>
> I'm trying to set the classpath for a groovysh session with the classpath
> switch (e.g. "-cp" or "-classpath"). On Linux (and under Cygwin with an
> sdkman-installed Groovy), it works fine.
> But under Windows (both Windows 7 64-bit and Windows 10 64-bit, installed
> using the Windows installer) I get this error:
> {quote}
> PS C:\> groovysh -cp .
> Unrecognized option: -cp
> error: jvm creation failed with code -1: unknown error
> PS C:\> groovysh -classpath .
> Unrecognized option: -classpath
> error: jvm creation failed with code -1: unknown error
> {quote}
> I'm using the current directory as an example argument, but I get the same
> error no matter what I try.
> In all cases (Linux, Cygwin w/ sdkman, Windows 7 and 10) this is Groovy 2.4.6
> with JVM 1.8.0_91). One other thing: the problem occurs whether I'm using
> PowerShell or cmd.exe.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)