如何从正在运行的应用程序中找出 Groovy 运行时版本? [英] How do I find out Groovy runtime version from a running app?

查看:18
本文介绍了如何从正在运行的应用程序中找出 Groovy 运行时版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够通过 groovy 脚本找出 Groovy 运行时的版本.我该怎么做?我在网上找到的例子显示了一种方法,但显然它在最新版本中已被弃用并删除.

I need to be able to find out the version of Groovy runtime via a groovy script. How do I do it? The examples I found on the net show a way, but apparently it has been deprecated and removed in the latest version.

推荐答案

这应该有效:

println GroovySystem.version

只要您使用的是 Groovy 1.6.6+

So long as you are on Groovy 1.6.6+

在此之前,它是:

println org.codehaus.groovy.runtime.InvokerHelper.version

但它已从更高版本的 Groovy 中删除

But that's been removed from later versions of Groovy

这篇关于如何从正在运行的应用程序中找出 Groovy 运行时版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆