× - 코드 및 콘솔 화면은 [ code ] 내용 [ /code ] 태그 처리하여 주세요.
- 강조하고자 하는 내용은 [ b ] 내용 [ /b ] 태그 처리하여 주세요.

java.lang.IllegalArgumentException 예외 발생

  • barogargle
    (바로가글)
  • barogargle's Avatar 이 글의 작성자
  • Offline
  • Newbie
  • Newbie
더보기
18 Mar 2017 03:08 #1980 작성자: barogargle
barogargle 님의 글: java.lang.IllegalArgumentException 예외 발생
안녕하세요~~

예외가 발생하는데요 늘 발생하는건 아닙니다..
아마도 어떤 조건이 맞아야 하는 것 같아요!! 참 이상합니다 ㅠㅠㅠ

java.lang.IllegalArgumentException: Illegal pattern character 'Y'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:776)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:577)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:502)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:477)

그냥 SimpleDateFormat인데 아무리 봐도 예외가 날 곳이 아니라서요..
혹시 같은 경험을 해보신 적 있을까요?

알려주세요~~~
더보기
22 Mar 2017 01:15 #1989 작성자: helloworld
helloworld 님의 답글: java.lang.IllegalArgumentException 예외 발생
제 추정이 맞다면

예외가 나는 곳은 JRE 6 이하이고
에러가 안나는 곳은 JRE 7 이상이라고 예상이 됩니다.

docs.oracle.com/javase/7/docs/api/java/t...impleDateFormat.html
자바 7 (이상)에서 "Y"는 Week year 이구요.

docs.oracle.com/javase/6/docs/api/java/t...impleDateFormat.html
자바 6 이하에서는 없어요. 그래서 JRE 7 이하라면 에러가 납니다.
Time to create page: 0.069 seconds
Powered by Kunena Forum