您如何调试 Java Applet? [英] How do you debug Java Applets?

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

问题描述

目前,我拥有的唯一信息是浏览器状态栏中的一行错误消息.

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:

打印出所有现有线程组.显示的第一组是组主要的.ac 代表活动计数;它是活动线程的总数在线程组及其子线程中组.agc 代表活动组数数;这是活动的数量线程组的子线程组.pri 代表优先级;它是线程组的优先级.下列的组主,其他线程组将显示为 Group ,其中名称是与小程序关联的 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:

这会设置跟踪级别选项,如下一节 跟踪和记录.

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 Applet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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