• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.text.ParseException: Unparseable date: "try this to invoke try-catch"

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting the following message when I try to run a program as a runnable jar file:

Parse Successful
Date with native format: Thu Aug 22 00:00:00 BST 2013
Formatted date : 08/22/2013
java.text.ParseException: Unparseable date: "try this to invoke try-catch"

Problem is that in the code I am not dealing with dates. Also it runs perfectly when run from eclipse.

The code does read in a file a line at a time and one of the fields in the line uses a date that has already been converted into a string and modified so it just looks like a string.

Thanks in advance

John

 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the problem is that the code is trying to parse the string "try this to invoke try-catch" into a date which it obviously can't do, but without seeing any code and the format of your input data nobody is going to be able to tell you why it is doing this.
 
John O'Donoghue
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have posted the code below. As you can see there is no mention of any dates and the input file is just plain text.

Could it be a set-up problem with how my eclipse installation produces jar files.


 
John O'Donoghue
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it is a setup problem as even classes that produced runnable jar files before now produce the same error if I make new jar files from them.

The command I am using is "java -jar ClassName.jar" which worked for the older jar files but not for new ones.
 
John O'Donoghue
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was a set up problem.

When I was making the runnable jar file, I wasn't setting the "Launch Configuration" settings properly.
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic