Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Ancient Java program freezes when using java MainFunctionClass but runs in debugger after breakpoint

  1. #1
    Junior Member
    Join Date
    Oct 2023
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ancient Java program freezes when using java MainFunctionClass but runs in debugger after breakpoint

    I am trying to help out a colleague who has a relatively old Java program (it last worked circa 2009).

    I can run the program just fine on an old (circa 2007 MacBook running Java 1.5.0_13), and I decided to see if I could get it running on my current Mac with Java 21 (openjdk version "21" 2023-09-19). Good luck, right?

    I found the main function in a class (`Sim`), and ran as follows:

    java Sim

    I got a splash screen and then the program freezes (well, button presses don't do anything).

    I decided to see what jdb would do, and I got the same issue, UNTIL I tried breaking on main and then continuing -- and it worked! It was able to get past the initial screen. Here is a video that shows what is going on:

    https://web.stanford.edu/~cgregg/would-be-gentleman-jdb.mov

    But, I'm stuck. I don't understand why jdb would only get past the first screen after breaking on main, and I'd like to figure out if there is some incantation of `java` I can use to run it normally. Thanks for any insight!

  2. #2
    Junior Member
    Join Date
    Oct 2023
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Ancient Java program freezes when using java MainFunctionClass but runs in debugger after breakpoint

    Well, sometimes stumbling around works -- using `-Xint` to disable JIT and AOT did the trick:

    java -Xint Sim

Similar Threads

  1. Java Debugger Program
    By breno in forum Java Theory & Questions
    Replies: 1
    Last Post: March 28th, 2014, 04:59 PM
  2. Problem In Accessing User Machine Command Prompt From Java Program Which Runs On Server
    By AbhijitFromBangalore in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 10th, 2013, 10:50 AM
  3. Java program runs out of memory (-xms1024 -xmx1024)
    By Jack Hammered in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 23rd, 2012, 10:29 AM
  4. Java Program that Runs in Background
    By 1bun100 in forum Java Theory & Questions
    Replies: 7
    Last Post: September 15th, 2011, 02:10 PM

Tags for this Thread