This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145696

Summary: Output is garbage (wrong encoding?)
Product: platform Reporter: hegjon <hegjon>
Component: Output WindowAssignee: t_h <t_h>
Status: RESOLVED WONTFIX    
Severity: blocker CC: anebuzelsky, dlipin, kfrank, mmirilovic, pchytil
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Unix   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot
The output is sometimes fine, not sure whats causing it
Output of the "Clean and Build" action, note some lines are OK, some garbled (jdk 1.5.0_14)
IDE log

Description hegjon 2008-08-30 18:24:09 UTC
All output from "external" processes are represented by squares.
Both Netbeans 6.5 Beta and Dev+patch #145462 have this behavior.
Comment 1 hegjon 2008-08-30 18:26:51 UTC
Information about my java encoding properties:

$ cat JavaProperties.java      
import java.util.Properties;

public class JavaProperties {
  public static void main(String[] args) {
    Properties properties = System.getProperties();
    properties.list(System.out);
  }
}
$ for jdk in /usr/local/jdk*; do echo $jdk && $jdk/bin/javac JavaProperties.java && $jdk/bin/java JavaProperties | grep
enc ; done
/usr/local/jdk-1.5.0
file.encoding.pkg=sun.io
sun.jnu.encoding=ISO8859-1
file.encoding=ISO8859-1
sun.io.unicode.encoding=UnicodeLittle
/usr/local/jdk-1.6.0
file.encoding.pkg=sun.io
sun.jnu.encoding=ISO8859-1
file.encoding=ISO8859-1
sun.io.unicode.encoding=UnicodeLittle
/usr/local/jdk-1.7.0
file.encoding.pkg=sun.io
sun.jnu.encoding=ISO646-US
file.encoding=ISO646-US
sun.io.unicode.encoding=UnicodeLittle
Comment 2 hegjon 2008-08-30 18:33:48 UTC
Created attachment 68715 [details]
Screenshot
Comment 4 hegjon 2008-09-01 12:56:05 UTC
Netbeans 5.5 also suffers from this bug.
Comment 5 t_h 2008-09-02 09:23:48 UTC
Is your temp directory on local or network drive?
Comment 6 dlipin 2008-09-02 11:19:29 UTC
Core team - sorry for prying into your affairs...

hegjon,

could you please advise where can I get all those JDKs that you have (/usr/local/jdk-1.5.0, /usr/local/jdk-1.6.0, /usr/
local/jdk-1.7.0) and how to install it? 
(I have a fresh install of OpenBSD 4.3 and not much experienced with it)

What are the versions of that JDKs? 
/usr/local/jdk-1.5.0/bin/java -fullversion
/usr/local/jdk-1.6.0/bin/java -fullversion
/usr/local/jdk-1.7.0/bin/java -fullversion

What JDK NetBeans is running on? can you post the info from Help->About dialog at this issue?
Does this issue happen if you run NB on the other JDK (e.g. using bin/netbeans --jdkhome /usr/local/jdk-1.6.0)?

Thanks,
Dmitry
Comment 7 hegjon 2008-09-02 12:12:58 UTC
t_h: My temp directory is on a local disk
Comment 8 hegjon 2008-09-02 12:48:35 UTC
Hi, Dmitry.

>could you please advise where can I get all those JDKs that you have (/usr/local/jdk-1.5.0, /usr/local/jdk-1.6.0,
/usr/local/jdk-1.7.0) and how to install it? 

As explained here http://openbsd.org/faq/faq8.html#Programming; OpenBSD cant redistribute binary packages, and you need
to build it from source. OpenBSD ports collection helps you.

Download and extract ports.tar.gz as root to /usr (ftp://ftp.uninett.no/pub/OpenBSD/4.3/ports.tar.gz)
1. tar -xvf ports.tar.gz -C /usr
2. cd /usr/ports/devel/jdk/1.5/ and type `make install`
Follow the instructions, (you need to download some files and put them into /usr/ports/distfiles)
This is the short version, and will take some time.
If your getting in to trouble and are using the amd64 version, I can make the the binary packages for you.
You can read more about the ports collection here: http://openbsd.org/ports.html
and more about the package system here: http://openbsd.org/faq/faq15.html

Good luck! :)


> What are the versions of that JDKs?
$ /usr/local/jdk-1.5.0/bin/java -fullversion
java full version "1.5.0_14-p8-root_20_aug_2008_21_44"
$ /usr/local/jdk-1.6.0/bin/java -fullversion
java full version "1.6.0_03-p4-root_21_aug_2008_17_24-b00"
$ /usr/local/jdk-1.7.0/bin/java -fullversion
openjdk full version "1.7.0-internal-hegjon_22_aug_2008_18_20-b00"


> What JDK NetBeans is running on? can you post the info from Help->About dialog at this issue?
I have tried all my version, getting the same output on all of them (jdk 1.7 also gives me a ugly font).

Help->About (--jdkhome /usr/local/jdk-1.5.0)
Product Version: NetBeans IDE 6.5 Beta (Build 200808111757)
Java: 1.5.0_14-p8; Java HotSpot(TM) 64-Bit Server VM 1.5.0_14-p8-root_20_aug_2008_21_44
System: OpenBSD version 4.4 running on amd64; ISO8859-1; en (nb)
Userdir: /home/hegjon/.netbeans/6.5beta

Help->About (--jdkhome /usr/local/jdk-1.6.0)
Product Version: NetBeans IDE 6.5 Beta (Build 200808111757)
Java: 1.6.0_03-p4; Java HotSpot(TM) 64-Bit Server VM 1.6.0_03-p4-root_21_aug_2008_17_24-b00
System: OpenBSD version 4.4 running on amd64; ISO8859-1; en (nb)
Userdir: /home/hegjon/.netbeans/6.5beta

Help->About (--jdkhome /usr/local/jdk-1.7.0)
Product Version: NetBeans IDE 6.5 Beta (Build 200808111757)
Java: 1.7.0-internal; OpenJDK 64-Bit Server VM 12.0-b01
System: OpenBSD version 4.4 running on amd64; ISO646-US; en (nb)
Userdir: /home/hegjon/.netbeans/6.5beta
Comment 9 hegjon 2008-09-02 21:03:58 UTC
Created attachment 68901 [details]
The output is sometimes fine, not sure whats causing it
Comment 10 dlipin 2008-09-03 12:22:07 UTC
Created attachment 68942 [details]
Output of the "Clean and Build" action, note some lines are OK, some garbled (jdk 1.5.0_14)
Comment 11 dlipin 2008-09-03 12:32:43 UTC
Created attachment 68944 [details]
IDE log
Comment 12 Tomas Danek 2008-09-04 14:44:19 UTC
just FYI, I think i've seen something similar on my ubuntu too some time ago.. AFAIK restart of ide helped in my case
Comment 13 Ken Frank 2008-09-07 01:03:20 UTC
hegion,

what locale are you running in when starting netbeans ?
what does help->about report about locale/encoding ?

are there any non basic ascii characters being used in the program,
in the path where nb is installed, in path or name of userdir,
in name of project or files under it ?

what is the project encoding property of this project ?
(see project properties to find this value)

ken.frank@sun.com
Comment 14 Ken Frank 2008-09-07 01:09:10 UTC
could be jdk font mapping - especially if for some other locale,
the font specified by output window might not found - am assuming
its a standard jdk font that is then mapped to real os font,
but also perhaps its hardcoded to a font that is not standard
jdk name or not one found in font props of jdk being used.
especially since all characters are not shown ok, and we assume
that some/all of them are basic ascii characters.

ken.frank@sun.com
Comment 15 t_h 2008-09-10 13:53:08 UTC
4a95b819da11
Comment 16 Quality Engineering 2008-09-11 17:33:11 UTC
Integrated into 'main-golden', will be available in build *200809111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4a95b819da11
User: Tomas Holy <t_h@netbeans.org>
Log: #145696 and #129099: using single RandomAccessFile for both writing and memory mapping. #145255 firing changes less often to avoid abusing AWT thread and reduce chance to run out of address space by mmaping
Comment 17 t_h 2008-09-16 12:59:49 UTC
*** Issue 131501 has been marked as a duplicate of this issue. ***
Comment 18 Petr Chytil 2008-10-16 16:03:05 UTC
Please hegjon, Dmitry,
could you help us with verifying this issue? I have no OpenBSD machine available here to reproduce it.
Comment 19 dlipin 2008-10-20 11:52:08 UTC
Still reproducible with 6.5RC1 (200810171318) with both jdk 1.5 and 1.6.

Product Version         = NetBeans IDE 6.5 RC1 (Build 200810171318)
Operating System        = OpenBSD version 4.3 running on i386
Java; VM; Vendor        = 1.6.0_03-p3; Java HotSpot(TM) Client VM 1.6.0_03-p3-root_03_sep_2008_10_08-b00; Sun 
Microsystems Inc.
Runtime                 = Java(TM) SE Runtime Environment 1.6.0_03-p3-root_03_sep_2008_10_08-b00
Java Home               = /usr/local/jdk-1.6.0/jre
System Locale; Encoding = en (nb); ISO8859-1
    
Comment 20 t_h 2008-10-20 13:57:34 UTC
OpenBSD is unsupported platform => P3
Comment 21 t_h 2009-03-25 11:50:40 UTC
unsupported platform
Comment 22 fcrowson 2009-11-19 15:02:12 UTC
(In reply to comment #20)
> OpenBSD is unsupported platform => P3

I appreciate that OpenBSD is an unsupported, but could advise me where output window text is generated in the source code?

Thanks

Fred

PS Thanks for a great IDE - it works well on OpenBSD apart from this font issue
PSS This issue is still happening with OpenBSD 4.6 and Netbeans 6.7.1

Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.7.0-internal; OpenJDK Client VM 17.0-b01
System: OpenBSD version 4.6 running on i386; ISO646-US; en (nb)
Userdir: /home/fred/.netbeans/6.7
Comment 23 schulte2004 2013-08-04 00:12:30 UTC
Product Version: NetBeans IDE 7.3 (Build 201306052037)
Java: 1.7.0_21; OpenJDK Server VM 23.21-b01
Runtime: OpenJDK Runtime Environment 1.7.0_21-b11
System: OpenBSD version 5.4 running on i386; UTF-8; de_DE (nb)
User directory: /home/schulte/.netbeans/7.3
Cache directory: /home/schulte/.cache/netbeans/7.3

Looking at this bug, the issue still exists. Is there any solution/workaround to this ?
Comment 24 scrottie 2015-11-14 21:51:15 UTC
This is the first result on Google (currently) for "netbeans output garbage", so I hope comments directed at end-users coming in from Google are not out of place.

The problem seems to be a disagreement between character encoding to use between NetBeans and Maven.  The default configuration works for default installs on supported platforms.  This config change may be useful in other situations.

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

  <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>

I'm using build 201511130002.  Change <encoding></encoding> to UTF-8 or UTF-16 as appropriate.  This matches the encoding shown in the Help->About dialogue box for me.  I was not able to add this to java/maven/conf/settings.xml in the distribution to accomplish the same thing.  Likewise, I don't see where in the config menus to change the same thing.
Comment 25 scrottie 2015-11-14 21:52:55 UTC
* likewise, change 3.0.5 to your version of Maven.