• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java code not working getting several errors  RSS feed

 
Tanya Fagan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



ant -f C:\\Users\\Tanya\\Documents\\NetBeansProjects\\JavaApplication3 -Dnb.internal.action.name=build jar
init:
Deleting: C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\build\built-jar.properties
Compiling 1 source file to C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\build\classes
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: illegal character: '\u201c'
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: ';' expected
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: ';' expected
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: ';' expected
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: illegal character: '\'
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: not a statement
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: illegal character: '\u201d'
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:28: error: not a statement
System.out.println(“This is my report in columns \n”
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:29: error: illegal character: '\'
+"+n\t”+x+"\t""+x*x
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:29: error: not a statement
+"+n\t”+x+"\t""+x*x
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:29: error: ';' expected
+"+n\t”+x+"\t""+x*x
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:30: error: illegal escape character
+"\+n\t”+y+'\t'+y*y
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:30: error: unclosed string literal
+"\+n\t”+y+'\t'+y*y
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:30: error: not a statement
+"\+n\t”+y+'\t'+y*y
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:31: error: illegal escape character
+"\+n\t”+z+'\t'+z*z);
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:31: error: unclosed string literal
+"\+n\t”+z+'\t'+z*z);
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:31: error: not a statement
+"\+n\t”+z+'\t'+z*z);
17 errors
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:923: The following error occurred while executing this line:
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\nbproject\build-impl.xml:263: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)



 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you paste this code from a word processor? You have several "smart" quotes (“ and ”) in the text. All quotes should be "straight" (").
 
Tanya Fagan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you that solved most of the issue but still getting two errors.

C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:31: error: illegal escape character
+"\+n\t"+y+'\t'+y*y
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:32: error: illegal escape character
+"\+n\t"+z+'\t'+z*z);
2 errors
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tanya Fagan wrote:Thank you that solved most of the issue but still getting two errors.

C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:31: error: illegal escape character
+"\+n\t"+y+'\t'+y*y
C:\Users\Tanya\Documents\NetBeansProjects\JavaApplication3\src\javaapplication3\JavaApplication3.java:32: error: illegal escape character
+"\+n\t"+z+'\t'+z*z);
2 errors

'+' does not need to be escaped.
 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have sorted out the mistake you made with the code tags (instructions in this link), and doesn't it look better now.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!