Results 1 to 8 of 8
  1. #1
    gcluis is offline Member
    Join Date
    Jan 2011
    Posts
    3
    Rep Power
    0

    Default Itīs posible to change the minimal day in first week of year width the jvm options ?

    By default the Calendar.WEEK_OF_YEAR uses MinimalDaysInFirstWeek = 4.

    Itīs posible to change the config of the jvm for use always MinimalDaysInFirstWeek = 1 ?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    It's locale based, so you'll want a variant for your locale presumably.
    I've not had to faff with that side of things, though.

  3. #3
    gcluis is offline Member
    Join Date
    Jan 2011
    Posts
    3
    Rep Power
    0

    Default

    I know that can change it in code width:

    Calendar a = Calendar.getInstance();
    a.setMinimalDaysInFirstWeek(1); // setMinimalDaysInFirstWeek is a non-static funtion

    but, Is it possible to change it for all the applications on my server width the jvm optioms?

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    If there is an option (a documented one anyway) for that it will be, at least referenced, in the API docs, probably in the description for that method you listed. Otherwise, there might be a -X or -XX option that can do this (those are undocumented and were all originally meant only for testing purposes but are, by default, included in the released JVM, kind of like cheat codes in games). Note that these options are not likely to work with IBM's JVM, and possibly not with OpenJDK, and probably not with any other third-party JVM. Google "Java -X min day first week" if you can't find anything in the API docs. Or, write to Oracle support asking about it (and wait a few years for an answer unless you send a check for a few thousand bucks along with it).

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Cross-posted just now.

  6. #6
    gcluis is offline Member
    Join Date
    Jan 2011
    Posts
    3
    Rep Power
    0

    Default

    SOLVED:

    In my default Locate:
    [espaņol (Espaņa)][es_ES]
    [minimalDaysInFirstWeek][4]
    [firstDayOfWeek][2]

    If I change the Locale width:
    [espaņol (Espaņa)][es]
    [minimalDaysInFirstWeek][1]
    [firstDayOfWeek][2]

    The jvm options:
    -Duser.language=es -Duser.country=

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    So Google helped, I see (or you begged for someone to Google it for you on even more sites). The -D options are not necessary if that is already your "language". Also, don't forget someway to change this on every system you deploy to, and, if the changes where made in the JDK/JRE subdirectories, with every Java upgrade.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    This is what I meant by a variant, though, so you don't change the original Locale file.
    This allows you to deploy a variant specific to your application.

Similar Threads

  1. Is it posible (Sound)
    By Dormage in forum Advanced Java
    Replies: 0
    Last Post: 11-26-2010, 07:52 PM
  2. Day of the Week Calculator
    By scheng12 in forum New To Java
    Replies: 0
    Last Post: 09-08-2009, 03:59 PM
  3. Date of first day, given the week in the year and the year...
    By Lee.J.Baxter in forum Advanced Java
    Replies: 1
    Last Post: 08-26-2009, 08:48 AM
  4. Minimal single threaded web server?
    By johann_p in forum New To Java
    Replies: 2
    Last Post: 04-24-2008, 04:37 PM

Tags for this Thread

Posting Permissions

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