当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 8.10下不能debug?
帖子发表于 : 2008-11-10 22:07 
头像

注册: 2008-02-22 13:46
帖子: 234
送出感谢: 0 次
接收感谢: 0 次
8.10 发布以后就马上安装了 之后使用安装sun-java6-jdk和eclipse(3.2)之后运行也正常

但是最近在eclipse之下debug不能够正确运行 显示terminneted。

即使加入Breakpoint也显示同样的信息。

后来重装jdk和elipse(官方3.4)

我曾经试图按照wiki上的java配置条目来从新设置环境变量

而该条目中有关jvm的设置貌似在8.10中不适用 因为/etc/下没有jvm文件

我仍然按照提示闯将jvm

这之后仍然debug仍然是相同的提示错误。。。

但是我曾经的ubuntu8.04 升级成8.10之后运行正常

才接触java和elipse不是很清楚使用

希望得到帮助

提前谢谢


附件:
文件注释: 变量栏也没有参数
debug1.png
debug1.png [ 97.25 KiB | 被浏览 295 次 ]

页首
 用户资料  
 
2 楼 
 文章标题 : Re: 8.10下不能debug?
帖子发表于 : 2008-11-10 22:11 
头像

注册: 2008-02-22 13:46
帖子: 234
送出感谢: 0 次
接收感谢: 0 次
从8.04升级到8.10的elipse的debug正常运行


附件:
Screenshot-Debug - DNASequence.java - Eclipse SDK .png
Screenshot-Debug - DNASequence.java - Eclipse SDK .png [ 134.71 KiB | 被浏览 297 次 ]

页首
 用户资料  
 
3 楼 
 文章标题 : Re: 8.10下不能debug?
帖子发表于 : 2008-11-11 14:56 
头像

注册: 2008-02-22 13:46
帖子: 234
送出感谢: 0 次
接收感谢: 0 次
感觉在ubuntu 8.10下的java设置有点不同

同样的代码在windows和ubuntu 8.04 下都能够正确的运行debug

显示main method 和 Varibles

但是ubuntu8.10的新版本确不能正常运行这段代码

报出‘disconnected, terminnated。。。’的错误 varible一栏也没有任何显示。

代码如下:

/**
* This class represents a DNA sequence of nucleotides 'A', 'T', 'C' and 'G'
* as a sequence of characters in a {@link String} object.
*
* @author iCarnegie
* @version 1.0.0
*/
public class DNASequence {

/* Contains the sequence of nucleotides. */
private String sequence;

/* Contains the number of nucleotide A */
private int numberOfA;

/* Contains the number of nucleotide T */
private int numberOfT;

/* Contains the number of nucleotide C */
private int numberOfC;

/* Contains the number of nucleotide G */
private int numberOfG;

/**
* Test driver for class <code>DNA</code>.
*
* @param args not used.
*/
public static void main(String[] args) {

String s = "ATTATCGGGGTAA";
DNASequence dnaSequence = new DNASequence(s);

if ((dnaSequence.getNumberOfA() == 4)
&& (dnaSequence.getNumberOfT() == 4)
&& (dnaSequence.getNumberOfC() == 1)
&& (dnaSequence.getNumberOfG() == 4)) {
System.out.println("Test case 1: get methods passed\n");
} else {
System.out.println("Test case 1: get methods failed !!!\n");
}

if (dnaSequence.twoConsecutive('T')) {
System.out.println("Test case 2: method twoConsecutive passed\n");
} else {
System.out.println(
"Test case 2: method twoConsecutive failed !!!\n");
}

if (dnaSequence.twoConsecutive('A')) {
System.out.println("Test case 3: method twoConsecutive passed\n");
} else {
System.out.println(
"Test case 3: method twoConsecutive failed !!!\n");
}

if (!dnaSequence.twoConsecutive('C')) {
System.out.println("Test case 4: method twoConsecutive passed\n");
} else {
System.out.println(
"Test case 4: method twoConsecutive failed !!!\n");
}
}

/**
* Constructs a <code>DNASequence</code> object that represents the sequence
* of nucleotides indicated by the chars in the <code>string</code> argument
* and counts the occurrences of each nucleotide in the sequence.
*
* @param initialSequence a string with the initial sequence of nucleotides.
*/
public DNASequence(String initialSequence) {

sequence = initialSequence;
countNucleotides();
}

/*
* Counts the occurrences of each nucleotide in the DNA sequence and then
* updates the values of the variables numberOfA, numberOfT, numberOfC, and
* numberOfG .
*/
private void countNucleotides() {

int numberOfA = 0;
int numberOfT = 0;
int numberOfC = 0;
int numberOfG = 0;

int index = 0;

while (index < sequence.length()) {

char nucleotide = sequence.charAt(index);

if (nucleotide == 'A') {
numberOfA++;
} else if (nucleotide == 'T') {
numberOfT++;
} else if (nucleotide == 'C') {
numberOfC++;
} else if (nucleotide == 'G') {
numberOfC++;
}
index++;
}

return;
}

/**
* Obtains the number of occurrences of nucleotide A in the sequence.
*
* @return the number of occurrences of nucleotide A.
*/
public int getNumberOfA( ) {

return numberOfA;
}

/**
* Obtains the number of occurrences of nucleotide T in the sequence.
*
* @return the number of occurrences of nucleotide T.
*/
public int getNumberOfT( ) {

return numberOfT;
}

/**
* Obtains the number of occurrences of nucleotide C in the sequence.
*
* @return the number of occurrences of nucleotide C.
*/
public int getNumberOfC( ) {

return numberOfC;
}

/**
* Obtains the number of occurrences of nucleotide G in the sequence.
*
* @return the number of occurrences of nucleotide G.
*/
public int getNumberOfG( ) {

return numberOfG;
}

/**
* Checks if the nucleotide specified by the argument occurs in two
* consecutive locations in the DNA sequence.
*
* @param input a <code>char</code> that represent the nucleotide.
* @return <code>true</code> if the specified nucleotide occurs two
* consecutive locations in the sequence.
* Returns <code>false</code> otherwise.
*/
public boolean twoConsecutive(char input) {

int index = 1;

while (index < sequence.length() - 1) {

int indexOfFirstNucleotide = index - 1;

char firstNucleotide = sequence.charAt(indexOfFirstNucleotide);
char secondNucleotide = sequence.charAt(index);

if ((firstNucleotide == input) || (secondNucleotide == input)) {

return true;

}
index++;
}

return false;
}
}

错误比较好找出来 但eclipse无法进行debug 即使加入breakpoint 也还是相同的提示错误。。。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译