Error "Decode error - output not utf-8" in Sublime Text

4

I've looked at various sites, several questions (including in stackoverflow itself) I searched a lot and could not get the Sublime Text 2 error yet:

  

[Decode error - output not utf-8]

; Save with Encoding -> UTF-8. My JDK is right in the variable PATH , I have a variable called JAVA_HOME with value (C: \ Program Files \ Java \ jre8 \ bin).

My JavaC.sublime-build is currently as it normally is:

{
    "cmd": ["javac", "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.java"
}

I changed the JavaC.sublime-build:

{
    "cmd": ["javac", "$file_name"], <- De "$file" para "$file_name"
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.java"
}

Now it is compiling without any error but when I put it:

{
    "cmd": ["javac", "$file_name"],
    "cmd": ["java", "$file_base_name"], <- Adicionei Está Linha
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.java"
}

He gave the error again [Decode error - output not utf-8]

Translating, for now I can only generate .class, but my purpose is to generate .class and run it as well.

    
asked by anonymous 30.11.2014 / 01:18

3 answers

1
"shell": true   

That's the key.

If I try a build system like this (on Win XP):

{
"cmd": ["ant", "-f", "project-build.xml"],
"working_dir": "${project_path}"
}

Give me:

  

[Decode error - output not utf-8]

This is because cmd should be "ant.bat" . Sublime is looking for a file whose name is exactly ant , and the encoding of the "file does not exist" message is not UTF-8. If you use the shell like this:

{
"cmd": ["ant", "-f", "project-build.xml"],
"working_dir": "${project_path}",
"shell": true
}

everything works (even without "windows": { "cmd": ....} because the shell searches for ant.exe and then ant.bat .

    
04.12.2014 / 20:11
0

See if your editor has the option to change the text's character, it's probably in cp1252, go to UTF-8 (in eclipse by right clicking on the project tree), Notepad ++ in the top menu "Format & gt ;> convert to UTF-8 "

I always work with fonts in UTF-8 the cp1252 gives many problems.

    
01.07.2015 / 13:46
0

In my case I decided to rename the folder containing the file. Leaving only a name, no periods, commas or spaces. I hope I have helped.

    
15.03.2017 / 20:34