Page 2 of 2 FirstFirst 12
Results 21 to 32 of 32
Like Tree4Likes

Thread: String.Format

  1. #21
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,290
    Blog Entries
    7
    Rep Power
    24

    Default Re: String.Format

    But the OP wasn't staring at a compilation error; he posted a runtime error, proving he ignored the compilation error, issued a bit before (a very unwise thing to do).

    kind regards,

    Jos (<-- sitting in the shade now ;-)
    allaudin likes this.
    The only person who got everything done by Friday was Robinson Crusoe.

  2. #22
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,296
    Rep Power
    9

    Default Re: String.Format

    Ah yes!! It had been so long ago. Anyway, we've come full circle. Check the settings.

    Enjoy the shade!
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #23
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,290
    Blog Entries
    7
    Rep Power
    24

    Default Re: String.Format

    Quote Originally Posted by jim829 View Post
    Enjoy the shade!
    I found a better solution: I'm sitting in the sun now while my little laptop is in the shade (sort of).

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  4. #24
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: String.Format

    I was just copying code form net and trying it on eclipse ...

  5. #25
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    5,296
    Rep Power
    9

    Default Re: String.Format

    You need to check your compliance level in Eclipse.
    Window --> Preferences --> Java --> Compiler (What is the level?)

    For JRE

    Window --> Preferences --> Java --> Installed JREs (which one is checked?)

    Regards,
    Jim
    allaudin likes this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #26
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: String.Format

    I read your conversation ... First it was working for Integer x = 10 ; but now showing the same error as in Double .. and Compilance level = 1.6 and jre7 ...
    I checked the version using (java -version) through command prompt .. and its 1.7.0_21

  7. #27
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,290
    Blog Entries
    7
    Rep Power
    24

    Default Re: String.Format

    Check whether or not the compliance settings are correct for your particular project, i.e. go to Project>Properties>Java Compiler.

    kind regards,

    Jos
    allaudin likes this.
    The only person who got everything done by Friday was Robinson Crusoe.

  8. #28
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: String.Format

    Done .... JosAH thank you so mush ... compilance level 1.4 was selected .. now I made it 1.6 and it worked .... again a bundle of thanks to you and jimi ... :)

  9. #29
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: String.Format

    One more question how can I make it 1.6 for all projects (default)???

  10. #30
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,290
    Blog Entries
    7
    Rep Power
    24

    Default Re: String.Format

    Go to Window>Preferences>Compiler and tick the box 'Use default compliance settings'. (why doesn't anyone read the included Eclipse user manual?)

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  11. #31
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: String.Format

    :) I did that earlier .. thanks .... don't be angry ... and after setting default to 1.6 .. now when I create project still its compliance level does not change to 1.6 :(
    Last edited by allaudin; 06-04-2013 at 12:14 PM.

  12. #32
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,290
    Blog Entries
    7
    Rep Power
    24

    Default Re: String.Format

    Check Project>Properties>Java Compiler; the particular (existing) project has its compliance level changed. b.t.w. I'm not angry, just surprised what a mess people can create out of ignorance. I strongly sugggest using just the command line tools instead of a sophisticated IDE.

    kind regards,

    Jos
    Last edited by JosAH; 06-04-2013 at 12:29 PM.
    The only person who got everything done by Friday was Robinson Crusoe.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Pls help to print string in given format
    By know.how in forum New To Java
    Replies: 2
    Last Post: 08-31-2011, 01:43 PM
  2. Help with checking for a certain format in a String
    By SteroidalPsycho in forum New To Java
    Replies: 2
    Last Post: 03-26-2010, 05:56 AM
  3. format content of String[]
    By eponcedeleon in forum Advanced Java
    Replies: 9
    Last Post: 02-23-2010, 06:12 AM
  4. String.format not in javadoc
    By ortollj in forum New To Java
    Replies: 3
    Last Post: 11-08-2009, 06:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •