Используйте expect
, например, я использую собственную Windows jdb
от Cygwin expect
:
#!/usr/bin/expect
set timeout -1
set CP "oracle-jdbc-tz-1.0.0-RELEASE.jar;C:\\Users\\user\\.m2\\repository\\com\\oracle\\jdbc\\ojdbc6\\11.2.0.4\\ojdbc6-11.2.0.4.jar"
cd target
# puts [pwd]
spawn jdb -classpath $CP -sourcepath ../src/main/java
expect ">"
send "stop in home.App.main\n"
expect ">"
send "run home.App\n"
expect "Breakpoint hit:"
send "stop in home.App.run\n"
expect -re "main... "
send "cont\n"
expect -re "main... "
send "stop in home.App.barrier\n"
expect -re "main... "
send "trace go methods\n"
expect -re "main... "
send "cont\n"
expect -re "main... "
# interact
send "quit\n"
expect eof
Чтобы получить путь к классам для запуска проекта Maven:
mvn dependency:build-classpath