Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Debugging Bash with a jar
Debugging Bash with a jar [message #841835] Wed, 11 April 2012 19:28 Go to next message
jeremy cunningham is currently offline jeremy cunninghamFriend
Messages: 2
Registered: April 2012
Junior Member
I was just given a java project to support. The code is just a bunch of pojo's that reads local files, creates bundled files similar to a tar file, writes them to memory and then shutdown. In prod they are kicked off with one bash script that reads a config file then kicks off the jar (compiled code from the java project) file. When the compiled code returns control to the 1st script it then kicks off another bash script that moves the output of the compiled code to an hdfs (hadoop) cluster. How would I debug this code while using all the bash scripts and the config file? I can kick off java project with some of the inputs it requires but the bash scripts are very complicated and pass around several variables. It would be nice to able to load the scripts into eclipse, kick off the scripts, debug them and when they call the java code, step into that. Any thoughts on how to do this?
Re: Debugging Bash with a jar [message #841863 is a reply to message #841835] Wed, 11 April 2012 20:08 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
You could have the bash scripts start the VMs used to run the jar files in debug mode. You could then remotely debug the jar files using the Eclipse remote debugging feature.
Re: Debugging Bash with a jar [message #842588 is a reply to message #841863] Thu, 12 April 2012 12:41 Go to previous messageGo to next message
jeremy cunningham is currently offline jeremy cunninghamFriend
Messages: 2
Registered: April 2012
Junior Member
Thanks for the response. I must admit I don't know how to do what you are suggesting. If you could, would you please give a bit more detail on how to do what you are suggesting?

Thanks
Re: Debugging Bash with a jar [message #842648 is a reply to message #842588] Thu, 12 April 2012 13:47 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Your bash scripts need to invoke the Java VM in order to run the jar files. You can add the arguments to start the VM in debug mode. The VM will then start and wait for a debugger to connect to it. In Eclipse, you can use the remote debug feature (Run->Debug Configurations->Remote Java Application) to connect up to the debug VM and then use the debugger as you would in Eclipse.

This is a pretty advanced topic, but then what you are trying to do is pretty advanced. You need to check the VM documentation to get the correct arguments to start the VM in debug mode. There is also a Remote Debugging section in the Java development user guide in the included Eclipse documentation.
Previous Topic:what's the difference between public DOM AST and internal AST
Next Topic:How to org.eclipse.core.resources.IResource -> org.eclipse.jdt.core.ICompilationUnit
Goto Forum:
  


Current Time: Tue Apr 16 20:49:05 GMT 2024

Powered by FUDForum. Page generated in 2.87838 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top