Hello Friends,

I have one project in Java but the exe file cant show the system.out.println messages.

I want to create a jar file in such a way that the error of file e.g. abc.java should be viewed when I click the jar file.

is there any possible way....

System messages => bad idea
Logger messages => good idea (example slf4j)

Yes but the software is already created and distributed to customers and is having some problems.

Since the software cannot be replaced we need to so something so that the software is as it is and we can also find the error.

You could create a batch file that executes the jar with a DOS window. Leave the window open when the java program finishes: use MORE. The contents of the DOS window could be copied and saved.
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'

why did you create an exe file in the first place? do you have issues with non-Windows OS? :)

Let me explain in detail....

Actually the software was created some 4-5 years ago and now it is having some error....

when a patient is registered a folder gets created with patientname and date....and the details of the patient that are stored in the database also gets stored in the textfile....

In case if there is a database crash these text file help to retsore the database....

but now the issue is if suppose the database is crashed and there is a patientfolder which dont have the textfile in it or may be the textfile is there but empty...the database will stop retrieving value after that patient....

so I want to trace the patient which shows the error...

since it is not possible to open each and every folder and check if the textfile exists in the patient folder as there can be more than 300 to 500 patients...

hope u understood the issue...

so I need to create a jar file that will track the patient which will show this error...

You could locally use visualVM, but you will never reach level of usage as your costumers.
I do not want to be rude but your company got screwed now and still didn't get that they are loosing face.
The reasonable solution, that will show pro-active approach from you, would be provide updated version of software for selected user group (hospitals/doctors having/reporting most problems) and use proper error reporting not silly system print outs.

Let me explain in detail....

Actually the software was created some 4-5 years ago and now it is having some error....

when a patient is registered a folder gets created with patientname and date....and the details of the patient that are stored in the database also gets stored in the textfile....

In case if there is a database crash these text file help to retsore the database....

but now the issue is if suppose the database is crashed and there is a patientfolder which dont have the textfile in it or may be the textfile is there but empty...the database will stop retrieving value after that patient....

so I want to trace the patient which shows the error...

since it is not possible to open each and every folder and check if the textfile exists in the patient folder as there can be more than 300 to 500 patients...

hope u understood the issue...

so I need to create a jar file that will track the patient which will show this error...

not really my point: you wanted to have an .exe and then you say: my .jar file can't do this.

well, they're not really related, are they? I just asked why you made it a .exe in the first place.

as to an answer, "the code can not be replaced"??? it's called upgrading. if you can't change the code, even if you 'fix' the current problem, you'll pretty soon have the same problem. providing your clients with an upgrade will be a lot less trouble than having to debug and trying to 'solve' the problem every time it occurs.

not really my point: you wanted to have an .exe and then you say: my .jar file can't do this.

well, they're not really related, are they? I just asked why you made it a .exe in the first place.

as to an answer, "the code can not be replaced"??? it's called upgrading. if you can't change the code, even if you 'fix' the current problem, you'll pretty soon have the same problem. providing your clients with an upgrade will be a lot less trouble than having to debug and trying to 'solve' the problem every time it occurs.

Thanks everyone but I solved my problem....

I created one file in vb.net that is working and solved my issue....

This question has already been answered. Start a new discussion instead.