Hopefully this is going to the correct place.
http://www.openbsd.org/faq/faq15.html#Problems says to mail the
maintain, and http://openports.se/devel/netbeans gives
http://openports.se/bbmaint.php?maint=ports|a|openbsd.org as the
maintainer.

The "Output" window in NetBeans shows garbled characters (boxes) when
the green "play arrow"/Run button is pressed.  This is reproducible
for me by starting NetBeans, picking "New Project", taking the default
of "Java", naming it "Hello World", then immediately pressing the
green arrow to run the default skeleton project.

NetBeans on OpenBSD (5.8, amd64, package current as of the other day)
continues to exhibit this problem first reported in 2008 to the
NetBeans bug tracker:
https://netbeans.org/bugzilla/show_bug.cgi?id=145696

No small number of OpenBSD people have chimed in there.
https://netbeans.org/bugzilla/show_bug.cgi?id=224526 seems to be
continuation of that bug.  Other platforms are affected by the same
basic failure mode.

The problem seems to be that NetBeans does not detect the encoding of
output from Maven, nor does it attempt to interrogate Maven's
configuration to learn the encoding it will likely use.  For example,
Maven emits UTF-16 and NetBeans interprets it as UTF-8 (or as ASCII,
how the OpenBSD port has its configured).

scott@fluffy:~$ /usr/local/netbeans/java/maven/bin/mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da;
2013-02-19 06:51:28-0700)
Maven home: /usr/local/netbeans/java/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/local/jdk-1.7.0/jre
Default locale: en_US, platform encoding: US-ASCII
OS name: "openbsd", version: "5.8", arch: "amd64", family: "unix"

I don't know why (stopped investigating at this point), but mvn says
the "Default locale" is "en_US" and platform encoding is "US-ASCII",
but this piece of configuration change (also documented in more detail
on the NetBeans ticket) fixes the garbled output:

In ~/NetBeansProjects/*/build.xml, at the top level (under <?xml...>),
where "*" is your project (or repeated for each project), at this:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.5</version>
        <configuration>
          <encoding>US-ASCII</encoding>
        </configuration>
      </plugin>
    </plugins>
  </build>

<version>...</version> needs to match Maven's version.  That file is
created for a project after the project is created.  Start NetBeans,
create the project, quit, edit the file, restart, then press "play",
and output should be non-garbled (or this worked for me at least).

I wasn't able to successfully apply this fix to
/usr/local/netbeans/java/maven/conf/settings.xml (perhaps it has a
different structure or needs to be installed somewhere to be used; I
didn't investigate).

I was able to reproduce this problem in the latest daily developer
release of NetBeans, dated yesterday, in addition to the 6.9.1 in
OpenBSD packages.

tl;dr It may be possible to fix the garbage from running a project
that shows up in the "Output" window with a config change to Maven or
NetBeans.

Thank you everyone for your work.  I send this in the hope that it is helpful.

-scott

P.S.:  The NetBeans project manager blocked me when I pressed him for
instructions on exactly how to change the config to work around this
when I refused to disclose my platform.  I am now persona non-gratis
there.  That happened after he contacted me offering to help resolve
my issue.

OpenBSD 5.8 (GENERIC.MP) #1236: Sun Aug 16 02:31:04 MDT 2015
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Reply via email to