J'ai un problème avec l'analyse de ma date. J'ai la date « Mittwoch, 28. 06. 2017 » comme une chaîne et en utilisant le code suivant pour l'analyser:Date impossible, mais en utilisant les paramètres régionaux corrects - Java
date = new SimpleDateFormat("EEEE, dd. MM. yyyy", Locale.GERMAN).parse("Mittwoch, 28. 06. 2017");
Mais me donne toujours l'erreur de date Unparseable. Si je l'exécute sur un autre système, cela fonctionne très bien.
Merci beaucoup
EDIT:
java.text.ParseException: Unparseable date: "Mittwoch, 28. 06. 2017"
at java.text.DateFormat.parse(DateFormat.java:366)
at Download.StartDownload(Download.java:88)
at Download.main(Download.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1770)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
at java.text.DateFormat.format(DateFormat.java:345)
at Download.StartDownload(Download.java:94)
at Download.main(Download.java:42)
... 5 more
EDIT: J'utilisais une version java ancienne qui a causé l'erreur.
Il faut vous dire pourquoi il ne peut pas unparse que. Publiez cette erreur afin que nous puissions vous aider. EDIT: ** publiez la stacktrace en tant que texte s'il vous plaît ** – AxelH
msg message d'erreur ainsi. – Sanjay
Cause par NullPointerException, c'est un début ... Quelle est la version de Java? – AxelH