olivier.melcher wrote:
> Hi,
>
> i'm started with Java Programming, i'm trying to run a very simple
> sample code.
>
> Can anyone tell me why it's not compiling right?
>
> I'm running Netbeans IDE 6.1 with Java JDK 6 on Linux OS (Ubuntu).
>
> I've got the Java API Do***entation placed in my Java Home Directory (/
> home/olivier/jdk1.6.0_06/docs)
>
> Here is the code:
>
> /*
> * To change this template, choose Tools | Templates
> * and open the template in the editor.
> */
>
> package myfirstproject;
>
> /**
> *
> * @[EMAIL PROTECTED]
olivier
> */
> class MyFirstJavaClass {
> /**
> * Method main
> *
> *
> * @[EMAIL PROTECTED]
args
> *
> */
> public static void main(String[] args) {
> System.out.println(“chocolate, royalties, sleep”);
> }
> }
>
>
> Here is the error message i get when trying to compile the code:
>
> init:
> deps-jar:
> Compiling 1 source file to /home/olivier/NetBeansProjects/
> MyFirstProject/build/cl*****
> /home/olivier/NetBeansProjects/MyFirstProject/src/myfirstproject/
> MyFirstJavaClass.java:21: illegal character: \8220
> System.out.println(“chocolate, royalties, sleep”);
> /home/olivier/NetBeansProjects/MyFirstProject/src/myfirstproject/
> MyFirstJavaClass.java:21: ';' expected
> System.out.println(“chocolate, royalties, sleep”);
> /home/olivier/NetBeansProjects/MyFirstProject/src/myfirstproject/
> MyFirstJavaClass.java:21: illegal start of expression
> System.out.println(“chocolate, royalties, sleep”);
> /home/olivier/NetBeansProjects/MyFirstProject/src/myfirstproject/
> MyFirstJavaClass.java:21: illegal character: \8221
> System.out.println(“chocolate, royalties, sleep”);
> 4 errors
> BUILD FAILED (total time: 0 seconds)
>
>
> Thanks for the help!
What happens if you compile from the command line:
cd /home/olivier/NetBeansProjects/MyFirstProject/src/myfirstproject/
javac MyFirstJavaClass.java
java MyFirstJavaClass


|