is it possible to debug a jar which is called inside a shell script

Posted on 2011-10-20
Medium Priority
Last Modified: 2012-05-12
I have  shell script which is calling  a jar by the following command
/sbin/java my.jar arg1

And it seems to fail while executing the jar.
I want to debug the jar step by step.
I have control over building hte jar also. Is there a way I  can put denug inforation into this?
Question by:pvinodp
LVL 86

Accepted Solution

CEHJ earned 668 total points
ID: 37000104
>>I have control over building hte jar also.

So why do you want to debug the jar and not into the source code during the build?
LVL 47

Assisted Solution

for_yan earned 664 total points
ID: 37000200
You should use -jar when executing the .jar like this:
/sbin/java -jar my.jar arg1

You first  run it withiut any script and if it does noit run debug it as a normal java program from a source code.
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 668 total points
ID: 37001044
How did you develop your jar? You should debug in your development environment like Eclipse or add a debug parameter to your code that will display a lot more information besides a stack trace. Are you getting an error or is your jar not doing what it should?

Author Closing Comment

ID: 37092540
thanks for the solution
LVL 86

Expert Comment

ID: 37099329

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question