Вот пример кода, который я скомпилировал:
Код: Выделить всё
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
System.out.println("Hello world! line 2");
System.out.println("Hello world! line 3");
}
}
Код: Выделить всё
$ ~/jdk-18.0.2.1/bin/jdb.exe Main
Initializing jdb ...
> stop at Main.main
Deferring breakpoint Main.main.
It will be set after the class is loaded.
> run
run Main
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started: Set deferred breakpoint Main.main
Breakpoint hit: "thread=main", Main.main(), line=3 bci=0
main[1] step
> Hell
Step completed: o world!
"thread=main", Main.main(), line=4 bci=8
main[1] step
> Hello world! line 2
Step completed: "thread=main", Main.main(), line=5 bci=16
main[1]
Код: Выделить всё
3 System.out.println("Hello world!");
Подробнее здесь: https://stackoverflow.com/questions/744 ... tep-output
Мобильная версия