Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JAVA_TOOL_OPTIONSによるJavaプロパティ指定
$ scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_80).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import java.util.{TimeZone, Calendar}
import java.util.{TimeZone, Calendar}
scala> TimeZone.getDefault
res0: java.util.TimeZone = sun.util.calendar.ZoneInfo[id="Etc/UTC",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
scala> Calendar.getInstance
res1: java.util.Calendar = java.util.GregorianCalendar[time=1494986054059,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Etc/UTC",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=4,WEEK_OF_YEAR=20,WEEK_OF_MONTH=3,DAY_OF_MONTH=17,DAY_OF_YEAR=137,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=1,HOUR_OF_DAY=1,MINUTE=54,SECOND=14,MILLISECOND=59,ZONE_OFFSET=0,DST_OFFSET=0]
scala> "こんにちは".getBytes
res2: Array[Byte] = Array(63, 63, 63, 63, 63)
$ JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8 -Duser.timezone=Asia/Tokyo" scala
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Tokyo
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_80).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import java.util.{TimeZone, Calendar}
import java.util.{TimeZone, Calendar}
scala> TimeZone.getDefault
res0: java.util.TimeZone = sun.util.calendar.ZoneInfo[id="Asia/Tokyo",offset=32400000,dstSavings=0,useDaylight=false,transitions=10,lastRule=null]
scala> Calendar.getInstance
res1: java.util.Calendar = java.util.GregorianCalendar[time=1494986090822,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Tokyo",offset=32400000,dstSavings=0,useDaylight=false,transitions=10,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=4,WEEK_OF_YEAR=20,WEEK_OF_MONTH=3,DAY_OF_MONTH=17,DAY_OF_YEAR=137,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=10,HOUR_OF_DAY=10,MINUTE=54,SECOND=50,MILLISECOND=822,ZONE_OFFSET=32400000,DST_OFFSET=0]
scala> "こんにちは".getBytes
res2: Array[Byte] = Array(-29, -127, -109, -29, -126, -109, -29, -127, -85, -29, -127, -95, -29, -127, -81)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment