Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't compile any code  RSS feed

 
Bart Wtoras
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm an absolute beginner in Java and programing. I've bought Head First Java book 2nd edition to learn something. After JDK installation I've tried to compile the very first code from the book, simple code about party invitation. I open MS Word and write code exactly the same as it is in the book. I rename file from party.docx to party.java. When i go to cmd, and run: javac party.java, cmd shows 100 errors and freezes so I have to shut the proces. I tried also with other codes and results are the same. Sorry for bothering you with such a noobish question and for my English. I run it on Win 7, Java 8, JDK 8 u66.
 
Charles D. Ward
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never use Word for writing Java code. Use something like Notepad++ instead.
 
Campbell Ritchie
Marshal
Posts: 55698
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good advice. And welcome to the Ranch
 
Bart Wtoras
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working now
Thank You very much.
 
Maged Saeed
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also try opening this word file with notepad or notepad++ and see how different is your code.
 
Campbell Ritchie
Marshal
Posts: 55698
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I don't think seeing the control characters will help much, I am afraid.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!