你如何进行调试Java小程序? [英] How do you debug Java Applets?

查看:286
本文介绍了你如何进行调试Java小程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的唯一信息是在浏览器的状态栏一行的错误消息。

Currently, the only information I have is a one-line error message in the browser's status-bar.

你知道我怎么能得到一个堆栈跟踪例如?

Do you know how I could get a stack-trace for example ?

推荐答案

这篇文章是有点老但仍然是相关的(包括了题为节如何调试小程序在Java插件)。

This article is a bit old but is still relevant (including a section entitled "How to Debug Applets in Java Plug-in").

编辑:也许是一个更好的方式来获得踪迹是使用的的Java插件控制台。如果您在该窗口中点击T,你会看到以下内容:

perhaps a better way to get stacktraces is to use the Java plugin console. If you hit "t" in that window, you'll see the following:

打印出所有现有的线程
  组。示出的第一组是组
  主要。交流代表活动的次数;它
  是活动线程的总数
  在一个线程组及其子线程
  组。 AGC代表活动组
  计数;它是活性的数目
  一个线程组的子线程组。
  PRI代表优先;它是
  线程组的优先级。以下
  集团主要的,其他的线程组会
  显示为组,其中name
  是与一个applet相关联的URL。
  线程的个人物品将
  显示线程名,线程
  优先级,活着如果线程是活着
  或毁坏如果线程处于
  被破坏的过程,守护
  如果该线程是守护线程。

Prints out all the existing thread groups. The first group shown is Group main. ac stands for active count; it is the total number of active threads in a thread group and its child thread groups. agc stands for active group count; it is the number of active child thread groups of a thread group. pri stands for priority; it is the priority of a thread group. Following Group main, other thread groups will be shown as Group , where name is the URL associated with an applet. Individual listings of threads will show the thread name, the thread priority, alive if the thread is alive or destroyed if the thread is in the process of being destroyed, and daemon if the thread is a daemon thread.

这是我最经常使用从控制台的其他命令0-5跟踪级别:

The other command that I've used most often from that console is the trace level from 0-5:

该设置跟踪级别选项下一节,<一个描述href=\"http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/tracing%5Flogging.html#tracing\">Tracing和记录。

This sets the trace-level options as described in the next section, Tracing and Logging.

在这个页面,你会看到的水平是这样的:

From that page, you'll see that the levels look like this:


      
  • 0 - 离

  •   
  • 1 - 基本

  •   
  • 2 - 网络,高速缓存和基本

  •   
  • 3 - 安全,网络和基本

  •   
  • 4 - 扩展,安全,网络和基本

  •   
  • 5 - LiveConnect的,扩展,安全,网络,温度和基本

  •   

这些工具都可以非常有用,因为你试图解开什么在世界上已经得到到您的小程序的头上。我知道,他们已经为我工作。

These tools can all be fairly useful as you're trying to unravel what in the world has gotten into the head of your applets. I know that they've worked for me.

这篇关于你如何进行调试Java小程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆