Jump to content

Illegal character

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Tank314

Tank314

    Newbie

  • Members
  • PipPip
  • 10 posts
Attached File  charac.jpg   10.19K   78 downloads
public class MittProgram{
    public static void main(String[] args){
        System.out.print("My first program");
    }
}
File[ATTACH]3784[/ATTACH]

From what I understand it has some invisible characters I can't remove.
I found this on google vb.net - Illegal Character when trying to compile java code - Stack Overflow
But I don't understand what is streamwrite constructor or file.writealltext and what should I do with em.

Attached Files



#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
What editor are you using? Are you saving in Unicode or ASCII?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
There is, for some reason or another (Notepad 2K?), a BOM character that probably doesn't show up on your editor before the 'p' in public. In gEdit you can just place the cursor before 'p' and press backspace to clear it. Windows editors however may not support that, and formerly Sun and now Oracle both haven't fixed this yet.
Wow I changed my sig!

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
You can freely open up with Windows notepad and save as ANSI, or open up a hex editor and remove the following from the beginning: EF BB BF
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
Simonxz

Simonxz

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
It's not the question but make sure you name your file the same name as your class. Your filename should be MittProgram.java. The compiler won't accept first.java.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users