blob: 8b69fd6df6d3cc86498a90d71bf76851c18c8a5b [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqTutorialsDebugging
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqTutorialsDebugging
:description: Apache NetBeans wiki DevFaqTutorialsDebugging
:toc: left
:toc-title:
:syntax: true
=== Debugging modules
Once your module is installed all error messages are sent to your `(NetBeans user directory)/var/log/messages.log`; use that for watching what's going on.
You can use `java.util.logging.Logger` (or `org.openide.util.Exceptions`) to report exceptions and informational messages to the log file.
You can debug your own module from within NetBeans just like you would any other project. However, if you want to step into NetBeans code then you need to download the NetBeans source.
You do not need to build it;
just tell NetBeans where your NetBeans source code lives using *Tools > NetBeans Platform Manager > Sources*.
If you still have strange problems stepping into NetBeans code, try the following:
* Open the NetBeans project that contains the code you are trying to access - for example, if you are stepping into the editor, open the NetBeans editor project.
* Now run the debugger again then open the debugger sources window (*Window > Debugging > Sources*) and ensure all the checkboxes are ticked.
* Now there is no reason why NetBeans debugging should fail!
To launch NetBeans in debug mode manually:
[source,java]
----
netbeans/bin/netbeans -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5858
----
then use *Run > Attach Debugger* and then choose Connector = SocketAttach, port = 5858 and timeout = 5000 and press OK.
_Note: if you run the debugged NetBeans instance on the same machine as your development IDE, do not forget to add _'--userdir xxx'_ parameter to the debugged instance's command line. Otherwise the debugged process might try to reuse the default userdir, which is most probably already taken up by the development IDE. The debugged NetBeans instance then terminates right after start with very undescriptive message or no messages at all._
<hr/>
Applies to: NetBeans 6.5+
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqTutorialsDebugging[http://wiki.netbeans.org/DevFaqTutorialsDebugging] ,
that was last modified by NetBeans user Jachym Vojtek
on 2013-07-31T06:52:24Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.