1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

いろんなプログラミング言語のバージョンをコード内で確認する方法

Last updated at Posted at 2019-04-18

プログラミング言語のバージョンをそのコードの中で確認する方法を集めてみた。

Elixir

System.version() # => "1.8.1"

Erlang

erlang:system_info(otp_release). % => "21"
erlang:system_info(version).     % => "10.2.3"

Go

import (
    "fmt"
    "runtime"
)

{
    fmt.Printf("Go: %s\n", runtime.Version())
}

結果

Go: go1.12.1

Groovy

GroovySystem.version // => 2.4.3

Java

System.getProperty("java.version"); // => 1.8.0_152-release

JavaScript(Node.js)

process.versions.node // => '11.9.0'

Julia

julia> VERSION
v"1.5.0"

Kotlin

KotlinVersion.CURRENT // => 1.2.41

Python

import sys
sys.version_info
# => sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)

import platform
platform.python_version_tuple()
# => ('3', '6', '8')

R

sessionInfo()
# => R version 3.5.1 (2018-07-02)
# 以下略

Ruby

RUBY_VERSION # => "2.6.3"

Scala

scala.util.Properties.versionNumberString // => 2.11.12

Rust

Rustは取れないのだろうか…。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?