Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:45:46+00:00 2026-05-28T07:45:46+00:00

I am compiling a package using maven and it says build failure with following

  • 0

I am compiling a package using maven and it says build failure with following compilation error:

SpanishTest.java[31, 81] unmappable character for encoding UTF8

I searched online and for many people, changing source encoding from UTF-8 to ISO-8859-1 seems to work but I am still getting same compilation error. I am using 32-bit Ubuntu. Here is how that tag looks in my pom.xml

<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>

Even if I change <project.build.outputEncoding> tag to ISO-8859-1, I still get the error.Could it be because of java version? I have both-sun java and openjdk installed on my system.

Can anyone please let me know what to do.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:45:46+00:00Added an answer on May 28, 2026 at 7:45 am

    Configure the maven-compiler-plugin to use the same character encoding that your source files are encoded in (e.g):

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>
    

    Many maven plugins will by default use the “project.build.sourceEncoding” property so setting this in your pom will cover most plugins.

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

    However, I prefer setting the encoding in each plugin’s configuration that supports it as I like to be explicit.

    When your source code is compiled by the maven-compiler-plugin your source code files are read in by the compiler plugin using whatever encoding the compiler plugin is configured with. If your source files have a different encoding than the compiler plugin is using then it is possible that some characters may not exist in both encodings.

    Many people prefer to set the encoding on their source files to UTF-8 so as to avoid this problem. To do this in Eclipse you can right click on a project and select Properties->Resource->Text File Encoding and change it to UTF-8. This will encode all your source files in UTF-8. (You should also explicitly configure the maven-compiler-plugin as mentioned above to use UTF-8 encoding.) With your source files and the compiler plugin both using the same encoding you shouldn’t have any more unmappable characters during compilation.

    Note, You can also set the file encoding globally in eclipse through Window->Preferences->General->Workspace->Text File Encoding. You can also set the encoding per file type through Window->Preferences->General->Content Types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When compiling the following simpleType with the XJC compile (from the JAXB package)... <xs:simpleType
I am using JDK 1.6.0_16, and Scala 2.7.7, compiling with maven. I do mvn
So I was compiling a package using javac -Xlint from the command prompt and
I have a problem with compiling custom widgetsets for my vaadin application using Maven.
I am trying to run a build file using Ant. I am using Maven
I am using the java.security package to verify some digital signatures. Basically I am
Packaging GWT project using mvn package fails and I have the following ouput: [INFO]
I'm using ghc 6.12.2 and the latest Data.HashMap 1.1.0 package, and while compiling with
I'm running the following code on Ubuntu 10.10, using OpenJDK 1.6.0_18: package mypkg; public
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.