Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 3rd, 2005, 03:29 AM
Authorized User
 
Join Date: Feb 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java 2 j2sdk1.4.2 for linux problem

Well starting to get my feet wet after @ 3 attempts at it last year.

did a simple OurFirstProgram (code below) and getting errors!!!

public class OurFirstProgram
{
    public static void main(String[] args)
    {
       System.out.println(¨this is my first program !¨);

Errors seem to be related to how i have quoted the string text
I have tried NO qoutes, single quotes and as seen above double quotes
and each give the same errors and error nos.

Is this because i HAVE got to use the JDK or the updated sdk and not the net beans version ?? (tho i think alls i have done is put the java 2 sdk under the netbeans dir).

    }
}

errors as per terminal screen are ....

[dave@localhost my console java apps]$ /home/j2sdk_nb/j2sdk1.4.2/bin/javac OurFirstProgram.java
OurFirstProgram.java:5: illegal character: \168
           System.out.println(¨this is my first program !¨);
                              ^
OurFirstProgram.java:5: illegal character: \168
           System.out.println(¨this is my first program !¨);
                                                         ^
OurFirstProgram.java:5: ')' expected
           System.out.println(¨this is my first program !¨);
                                                           ^
3 errors
 
Old February 3rd, 2005, 04:33 AM
Registered User
 
Join Date: Jan 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rbonslat
Default

Those weren't quotes, I'm not sure what those were. You also need two closing brackets. Here:

public class OurFirstProgram
{
    public static void main(String[] args)
    {
       System.out.println("this is my first program !");
   }
}

 
Old February 3rd, 2005, 04:58 AM
Authorized User
 
Join Date: Feb 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 

Quote:
quote:Those weren't quotes, I'm not sure what those were. You also need two closing brackets. Here:

public class OurFirstProgram
{
    public static void main(String[] args)
    {
       System.out.println("this is my first program !");
   }
}
sorry but where do the brackets go ???

to explain further...

I purchased a copy of java 2 beginning by Ivor Horton and on page28 i copied his 1st sample program. as below (without my comments).

Code:
public class OurFirstProgram
{
    public static void main(String[] args)
    {
       System.out.println(¨this is my first program !¨);
    }
}
the errors are about the quotation marks and tried to see if i could solve this my tring no quotes or single quotes. hense the second question (maybe not so clearly written) which is ...

because i installed netbeans ide and even tried it under that enviroment (and getting the simlar errors) I wanted to know if i should install the proper SDK rpm (running Mandrakelinux which is the compiled install program).
 
Old February 5th, 2005, 06:15 AM
Authorized User
 
Join Date: Feb 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by rbonslat
 Those weren't quotes, I'm not sure what those were. You also need two closing brackets. Here:

public class OurFirstProgram
{
    public static void main(String[] args)
    {
     System.out.println("this is my first program !");
}
}

done some investigation via a hex editor.

would be interested if you could tell me the hex value you get for a double quote.

In my Mandrake 10.0 system it gives me Hex 22 (in code i got off a CD) but in my code (sample i had posted) it was ab Hex.

so maybe something is going wrong on my keyboard.

cheers.

dave.
 
Old February 5th, 2005, 12:24 PM
Registered User
 
Join Date: Jan 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rbonslat
Default

Let me see how to explain this. I don't think it has anything to do with Java SDK. I copied, pasted and compile your exact same code on my text editor and it gave me this:

C:\Documents and Settings\Robert\Desktop\OurFirstProgram.java:5: illegal character: \168
       System.out.println(¨this is my first program !¨);
                          ^
C:\Documents and Settings\Robert\Desktop\OurFirstProgram.java:5: illegal character: \168
       System.out.println(¨this is my first program !¨);
                                                     ^
C:\Documents and Settings\Robert\Desktop\OurFirstProgram.java:5: ')' expected
       System.out.println(¨this is my first program !¨);
                                                       ^
3 errors

this seems to be the same error message 168 to me. Now when I deleted the imposter quotes that you have and added real quotes, it compiled successfully.

public class OurFirstProgram
{
    public static void main(String[] args)
    {
       System.out.println("this is my first program !");
   }
}


 
Old February 5th, 2005, 12:28 PM
Registered User
 
Join Date: Jan 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rbonslat
Default

It is obvious you have a keyboard malfunction. Try going on the internet to find out what the issue is.

 
Old February 16th, 2005, 12:52 AM
Authorized User
 
Join Date: Feb 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,

I am tending to agree with you (that the Quotes are the problem).

infact i had thought this right from the beinging and was wanting someone to confirm my suspections.

Since starting this thread I placed my problem on a more local (to where I live) list and got the same answer/replies.

Tried using sun beans 3.6 ide got the same errors.

Oh well time to think (might see if i can get a loan of a keyboard) from work over the weekend as this might solve my problem.

thanks to all who have helped me with this issue.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in Java to launch ExamXML on Linux joeandersen Java Basics 1 May 16th, 2007 08:12 AM
linux kernel compilation problem abhishekshrivastav Linux 4 October 13th, 2006 06:47 AM
how to execute Java program from Linux platform? sumandasgupta_2k Java Basics 1 April 6th, 2006 02:59 PM
How to set Java HotSpot Server VM for Linux suhasw J2EE 0 February 25th, 2004 01:44 AM
Install problem Redhad Linux 9 starcmd All Other Wrox Books 0 February 16th, 2004 03:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.