Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-27-2009, 07:55 PM   #1
Registered: Sep 2009
Posts: 174

Rep: Reputation: Disabled
Sun JDK 1.6.0_17 jdb Broken under Fedora 11??

Hard to believe, but that is what it looks like. I would welcome a better explanation though.

I have this dirt simple program that seems to break jdb. That is, I start up the program under jdb, put the execution point at main, say 'next' and the program runs to completion instead of stepping through one high level instruction in the current stack frame!

The program is:
class KnuthAlgGF2 {
    public static void main(String[] args) {
	int n = 4; // again deferring issue of whence this really should come: n-tuple is -4tuple as on p. 3
        //G1. [Initialize.] set aj<-0 for 0<=j<n; also set ainf <-0
	int[] a = new int[n+1];
	int ainf=0;
	int i=0;           // need outside loop to assign to j
	int j=0;           // Knuth did not initialize here, so neither will I. But this confuses jdb, so now adding init.
	int tmpi=0;

        //G2. [Visit.] Visit the n-tuple (an-1, ... a1, a0)
	// once again, 'visit' means 'print'
	for (tmpi=0;tmpi<5;tmpi++) {
	    System.out.println("Current array a is: ");
	    for(int k=0;k<n;k++) System.out.print(a[k]);

I compile this with "javac -g KnuthAlgGF2", then launch under jdb with either "jdb -launch KnuthAlgGF2" or "jdb KnuthAlgGF2" (then setting breakpoint somewhere). Either way, it ignores the breakpoint, runs to completion and then exits.

What is going on here? Has anyone else encountered a similar problem? Surely nothing in the program should break jdb this badly.

I have neither CLASSPATH nor JAVA_HOME set. But I never heard of that causing this problem, either.

AFAIK, all of 'java', 'javac' and 'jdb' should show up in the PATH only once, in /usr/bin/java, which in turn points to /etc/alternatives, which in turn points to 'usr/java/jdk1.6.0_17/bin/java' (for example).

Or am I confusing jdb with gdb? jdb actually seems to work better if I do NOT compile with the '-g' flag -- necessary for gdb. Is this flag really for 'custom' debug -- whatever that would really mean?

Last edited by mejohnsn; 12-28-2009 at 01:25 PM. Reason: Yet another closely related question.
Old 01-25-2010, 12:58 AM   #2
Registered: Sep 2009
Posts: 174

Original Poster
Rep: Reputation: Disabled
I have not figure out what has since changed, or whether it was all cockpit error in the first place: but I no longer have the problem.


fedora, java

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updated to Sun Java JDK 6 on Debian - Tomcat 5.5 Broken ronkymac Linux - Server 3 07-02-2009 09:05 AM
Auto Update Sun-JDK possible under Fedora 9? algogeek Linux - Software 1 08-16-2008 02:49 AM
Sun JDK installed on Fedora 8 but it is not there mulersh Linux - Software 1 04-12-2008 11:29 PM
LXer: How To Install Sun Java SE 6 JDK and NetBeans 5.5.1 - Fedora 7 LXer Syndicated Linux News 0 08-22-2007 06:51 PM
Sun JDK 6 and Fedora 7 problems RoughEdge Fedora 4 06-30-2007 11:59 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration