• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
John O'Donoghue
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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

 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!