From Fedora Project Wiki
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Preparations ==


For all Java subsystem debugging, installing the symbols package ''java-1.6.0-openjdk-debuginfo'' is essential. All debuginfo sub-packages reside in own repository which needs to be enabled for installation at least. An example yum command:
OpenJDK package name on Fedora is ''java-1.?.0-openjdk''.
<pre>
# yum install --enablerepo=fedora-debuginfo -y java-1.6.0-openjdk-debuginfo
</pre>


=== Fedora release > 15 ===


Since Fedora 15, Java console has been removed from ''Firefox Web developer tools add-on'' and it hasn't existed in the browser itself for some time. Related mozilla.org bugs:
== Java Consoles ==
* [https://bugzilla.mozilla.org/show_bug.cgi?id=511884 Bug 511884 - SeaMonkey 2.0/2.1 (Conditionally) Remove obsolete 'Java Console' item]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=460244 Bug 460244 - Unable to open Java Console after installing JRE6u10]


Background for this change was that nowdays there can be more than one JVM instance connected to a web browser and thus console feature was moved to JVM itself. Command:
There are at least 2 consoles:
<pre>
* OpenJDK 8
# yum install --enablerepo=fedora-debuginfo -y icedtea-web
** Monitoring ...
</pre>
** Policy ...
* IcedTea  (deprecated ??)
** Monitoring
** Policy ...


would install console support. There is also packages ''icedtea-web-debuginfo'' and ''icedtea-web-javadoc''.
== shared library paths ==


== Standard Output / Standard Error Output ==
OpenJDK's '''java.library.path''', shared library paths for i386 are:
 
<pre>
'''Firefox''' detected plugin list can be seen by typing the url:
/usr/lib
<pre>about:plugins</pre>
/usr/lib/jvm/java-1.?.0-openjdk-1.?.0.0.x86_64/jre/lib/
 
Firefox can be run in debug mode as follows:
<pre>$ ICEDTEAPLUGIN_DEBUG=true firefox 2>&1 | tee console.log
</pre>
</pre>
This will write the standard output also to a file.


Browser plugin also writes files under user's
and for x86_64:
<pre>
<pre>
~/.icedteaplugin/java.stdout 
/usr/lib64
~/.icedteaplugin/java.stderr
/usr/lib/jvm/java-1.?.0-openjdk-1.?.0.0.x86_64/jre/lib/amd64/
</pre>
</pre>


All these files are valuable information which can/should be attached to a bug reports.


== Attaching a debugger ==
When running in debug mode (with ICEDTEAPLUGIN_DEBUG=true), it is also possible to attach a debugger to JVM process, thus allowing stepping through applet code and the plugin code itself.


Once the applet is loaded, just attach the debugger of your choice to port 8787, and you can then set breakpoints in the applet code.
== Java subsystem debugging ==


Sometimes it may be necessary to debug the applet's init function. To to do that, first load a simple (working) applet in the browser. If you load http://www.gnu.org/software/classpath/, that should do it (the top left corner has an applet). This will start the JVM, allowing you to attach a debugger to it. Once the debugger is attached, you can set up breakpoints in the applet code and then proceed to load the applet. If you are using the NP plugin (default in Fedora 13 and higher), you need to load your applet applet in another tab. Loading it in the same tab will ''not'' work, as the VM will be shutdown as soon as the previous page closes to load the new one.
=== Preparations ===


== Java Console ==
For all Java subsystem debugging, installing the symbols package ''java-1.8.0-openjdk-debuginfo'' is essential. All debuginfo sub-packages reside in own repository which needs to be enabled for installation at least. An example yum command:
 
<pre>
OpenJDK does not ship the ''Java console'' anymore, but one can be found from Firefox [https://addons.mozilla.org/en-US/firefox/addon/60 Web Developer] add-on which is installed separately to the Firefox. Add-ons are installed using Firefox's own software component management system, not Fedora's RPM.
# dnf install --enablerepo=fedora-debuginfo -y java-1.8.0-openjdk-debuginfo
 
</pre>
Once Web Developer add-on has been installed, it can be activated from:
 
  '''View --> Toolbars --> Web Developer Toolbar'''
 
and that will open a new toolbar above the browser's rendering area. Java Console can be then opened from:
 
  '''Tools --> Java Console'''


=== Applets ?? ===


=== Fedora release > 15 ===
'''Applets are deprecated, no ???'''


Console has moved to icedTea itself (requires ''icedtea-web'' package). Activating the console can be done with gui-tool:
Console has moved to icedTea itself (requires ''icedtea-web'' package). Activating the console can be done with gui-tool:
Line 66: Line 49:




Console can for example list detailed information about the environment which can be useful for bugreporting:
Console can for example list detailed information about the environment which can be useful for bug reporting:


<pre>
<pre>
Line 142: Line 125:




== Test URLs ==
=== Test URLs ===


Fedora's JRE in browser environment can be tested using the following test pages:
Fedora's JRE in browser environment can be tested using the following test pages:
Line 148: Line 131:
* [http://java.com/en/download/installed.jsp?detect=jre&try=1 http://java.com/en/download/installed.jsp?detect=jre&try=1]
* [http://java.com/en/download/installed.jsp?detect=jre&try=1 http://java.com/en/download/installed.jsp?detect=jre&try=1]


Note that those pages itself are sad examples of compliance of specifications:
[http://validator.w3.org/check?uri=http://java.com/en/download/installed.jsp?detect=jre&try=1 buggy]
or
[http://validator.w3.org/check?uri=http://www.java.com/en/download/help/testvm.xml buggier]
- if you know any better pages, change them here.


= See Also =
= See Also =
Line 156: Line 144:
* [https://addons.mozilla.org/en-US/firefox/addon/60 Firefox Web Developer Add-on]
* [https://addons.mozilla.org/en-US/firefox/addon/60 Firefox Web Developer Add-on]


[[Category:Java]]
[[Category:Debugging]]

Latest revision as of 19:02, 19 October 2017

OpenJDK package name on Fedora is java-1.?.0-openjdk.


Java Consoles

There are at least 2 consoles:

  • OpenJDK 8
    • Monitoring ...
    • Policy ...
  • IcedTea (deprecated ??)
    • Monitoring
    • Policy ...

shared library paths

OpenJDK's java.library.path, shared library paths for i386 are:

/usr/lib
/usr/lib/jvm/java-1.?.0-openjdk-1.?.0.0.x86_64/jre/lib/

and for x86_64:

/usr/lib64
/usr/lib/jvm/java-1.?.0-openjdk-1.?.0.0.x86_64/jre/lib/amd64/


Java subsystem debugging

Preparations

For all Java subsystem debugging, installing the symbols package java-1.8.0-openjdk-debuginfo is essential. All debuginfo sub-packages reside in own repository which needs to be enabled for installation at least. An example yum command:

# dnf install --enablerepo=fedora-debuginfo -y java-1.8.0-openjdk-debuginfo

Applets ??

Applets are deprecated, no ???

Console has moved to icedTea itself (requires icedtea-web package). Activating the console can be done with gui-tool:

 Program menu --> Settings --> IcedTea Web Control Panel

Icedtea-web-debug-1.0.5.png


Console can for example list detailed information about the environment which can be useful for bug reporting:

System Properties:

http.agent: Java(tm) 2 SDK, Standard Edition v1.6.0_0
package.restrict.definition.java: true
java.version.applet: true
java.runtime.name: OpenJDK Runtime Environment
sun.boot.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64
java.vm.version: 14.0-b16
browser: sun.applet.AppletViewer
java.vendor.applet: true
java.vm.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
path.separator: :
java.vm.name: OpenJDK 64-Bit Server VM
file.encoding.pkg: sun.io
file.separator.applet: true
user.country: US
sun.java.launcher: SUN_STANDARD
sun.os.patch.level: unknown
os.version.applet: true
java.vm.specification.name: Java Virtual Machine Specification
user.dir: /home/tuju/Documents
java.runtime.version: 1.6.0_0-b16
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
java.endorsed.dirs: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed
os.arch: amd64
browser.version: 1.06
javax.accessibility.assistive_technologies: org.GNOME.Accessibility.JavaBridge
line.separator: 

java.io.tmpdir: /tmp
java.vm.specification.vendor: Sun Microsystems Inc.
os.name: Linux
java.class.version.applet: true
sun.jnu.encoding: UTF-8
java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/lib64/firefox-3.5.5:/usr/lib64/firefox-3.5.5/plugins:/usr/lib64/firefox-3.5.5:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.class.version: 50.0
java.specification.name: Java Platform API Specification
path.separator.applet: true
sun.management.compiler: HotSpot 64-Bit Server Compiler
package.restrict.definition.sun: true
os.arch.applet: true
os.version: 2.6.30.9-96.fc11.x86_64
browser.vendor: Sun Microsystems Inc.
user.home: /home/tuju
user.zoneinfo.dir: /usr/share/javazi
user.timezone: Europe/Tallinn
java.awt.printerjob: sun.print.PSPrinterJob
line.separator.applet: true
java.specification.version: 1.6
file.encoding: UTF-8
java.class.path: .
user.name: tuju
os.name.applet: true
java.vm.specification.version: 1.0
java.home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
sun.arch.data.model: 64
user.language: en
java.specification.vendor: Sun Microsystems Inc.
java.vm.info: mixed mode
java.version: 1.6.0_0
java.ext.dirs: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/classes
java.vendor: Sun Microsystems Inc.
file.separator: /
java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding: UnicodeLittle
sun.cpu.endian: little
java.vendor.url.applet: true
sun.cpu.isalist: 


Test URLs

Fedora's JRE in browser environment can be tested using the following test pages:

Note that those pages itself are sad examples of compliance of specifications: buggy or buggier - if you know any better pages, change them here.

See Also

References