2

Can't compile your project in NetBeans, here is the error:

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.094s
Finished at: Sat Nov 17 00:23:08 MSK 2012
Final Memory: 8M/247M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project AdminCmd: Compilation failure
C:\Users\Максим\Documents\NetBeansProjects\AdminCmd\src\main\java\be\Balor\Tools\Help\String\ACMinecraftFontWidthCalculator.java:[30,33] error: unmappable character for encoding Cp1251
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

here's the file maven on that swears

http://pastebin.com/buQEE4Fb

Project to Git - https://github.com/Belphemur/AdminCmd

If someone could put a working draft of NetBeans or Eclipse!

Cœur
  • 37,241
  • 25
  • 195
  • 267
a225892
  • 21
  • 1
  • 2

3 Answers3

2

This is interesting, as your pom.xml mentions

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

.. but the error message complains about Cp1251 encoding. Does the maven output mention anything else related to source encodings?

My recommendation is generally to not use any high-ASCII characters in your code, and use the \uxxxx notation instead as needed.

You can make the conversion from UTF-8 to escaped unicode at online conversion sites like http://www.endmemo.com/convert/EMUnicode.php (this particular one seems to strip leading zeroes, I don't think that's legal in Java)

Arnout Engelen
  • 6,709
  • 1
  • 25
  • 36
  • Please help us correct the error and throw off the finished project? I would be very grateful. I'm just not much misunderstood. Many thanks in advance! – a225892 Nov 16 '12 at 20:59
2

In my case I resolved that problem by setting new environment variable:

JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

In the command line executing maven, run current command before executing maven command:

SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

1

You have characters in that file which are likely not mapped in the Windows codepage (which is the reference to Cp1251). Try changing the project encoding to UTF-8 or similar. Look into different encoding schemes.

Thorn G
  • 12,620
  • 2
  • 44
  • 56
  • I've gleaned a different encoding. Do not help to select and compile the project. If everything compiles, then throw the finished project? I would be very grateful to you! – a225892 Nov 16 '12 at 20:57