Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2005, 03:29 AM
Authorized User
 
Join Date: Feb 2005
Location: chch, n/a, New Zealand.
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
Reply With Quote
  #2 (permalink)  
Old February 3rd, 2005, 04:33 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
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 !");
   }
}

Reply With Quote
  #3 (permalink)  
Old February 3rd, 2005, 04:58 AM
Authorized User
 
Join Date: Feb 2005
Location: chch, n/a, New Zealand.
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).
Reply With Quote
  #4 (permalink)  
Old February 5th, 2005, 06:15 AM
Authorized User
 
Join Date: Feb 2005
Location: chch, n/a, New Zealand.
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.
Reply With Quote
  #5 (permalink)  
Old February 5th, 2005, 12:24 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
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 !");
   }
}


Reply With Quote
  #6 (permalink)  
Old February 5th, 2005, 12:28 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
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.

Reply With Quote
  #7 (permalink)  
Old February 16th, 2005, 12:52 AM
Authorized User
 
Join Date: Feb 2005
Location: chch, n/a, New Zealand.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:21 PM.


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