This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Jun 21, 2010 4:04 AM by 807580 RSS

Java Web Start problem in Windows 7

807580 Newbie
Currently Being Moderated
My Application launches through java web start. UI is designed in Java swings. Title bar shows the DB server time when the user logs into my Application. When i launch the application in XP and Vista, the time displays correctly IST(+5.30 Time zone as per system time setting). But the same displays GMT time in Windows 7 OS. Even if the time zone is altered it sticks to the GMT time. Tried a lot in windows7 time settings like(changing time zone, changing system locale). But nothing worked.... Please Help.
My application runs in following environment.
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
  • 1. Re: Java Web Start problem in Windows 7
    793415 Pro
    Currently Being Moderated
    arunmurugan wrote:
    My Application launches through java web start. UI is designed in Java swings. Title bar shows the DB server time when the user logs into my Application. When i launch the application in XP and Vista, the time displays correctly IST(+5.30 Time zone as per system time setting). But the same displays GMT time in Windows 7 OS.
    OK the problem is Win. 7, and Win. 7 is running ..
    My application runs in following environment.
    java version "1.3.1_01"
    .. Java *1.3?!?*

    Please point the Win. 7 machine at this link and report back ..
    [http://pscode.org/prop/?prop=java.version,java.vm.version,os.name,os.version]
  • 2. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    The url which you gave, returned this result...

    java.version     1.6.0_20
    java.vm.version     16.3-b01
    os.name     Windows 7
    os.version     6.1

    actually it was a fresh OS installation. Ur url needs java plugin. While installing the plugin, the java got updated to this version. Any ways now also the time in my application shows in GMT.
  • 3. Re: Java Web Start problem in Windows 7
    793415 Pro
    Currently Being Moderated
    arunmurugan wrote:
    The url which you gave, returned this result...

    java.version     1.6.0_20
    Is the DST problem fixed?
  • 4. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    Is the DST problem fixed?
    I dont find problem in Daylight Saving Time as mine is IST(gmt +5.30 time zone). I dont have the DST check box either, in the time zone setting.
  • 5. Re: Java Web Start problem in Windows 7
    793415 Pro
    Currently Being Moderated
    arunmurugan wrote:
    Is the DST problem fixed?
    I dont find problem in Daylight Saving Time as mine is IST(gmt +5.30 time zone). ..
    Sorry, my bad. I meant to ask "Is the *IST* problem fixed?".

    Or to put that another way, is the original problem on Win 7 fixed, when using the 1.6.0_20 JRE?
  • 6. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    is the original problem on Win 7 fixed, when using the 1.6.0_20 JRE?
    No Andrew... Its still the same.... That problem is still there... Any solution for this?
  • 7. Re: Java Web Start problem in Windows 7
    793415 Pro
    Currently Being Moderated
    arunmurugan wrote:
    is the original problem on Win 7 fixed, when using the 1.6.0_20 JRE?
    No Andrew... Its still the same.... That problem is still there... Any solution for this?
    There are some more things we need to check:
    - Test for whether it is exclusive to web start.
    - Results from multiple machines to show it only affects Win. 7 (with JRE versions for each machine).

    Can you come up with a sand-boxed, publicly available URL to test? Self-contained simple code to demonstrate the problem?

    We'll have to start considering the course of action outlined below, but as I was typing that I thought 'could use some more info. first'.
    -------------------------------
    Your best bet is probably to:
    1) Check the [bug database|http://bugs.sun.com/] for "win 7 timezone". Then when you realise those 7 hits are reported against old versions..
    2) Raise a new bug report.
  • 8. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    There are some more things we need to check:
    - Test for whether it is exclusive to web start.
    I think its not exclusive to web start...
    Came accross this link.. just check..
    [Time Difference between application and Windows|http://social.answers.microsoft.com/Forums/en-US/w7programs/thread/67cd28ba-2abf-4033-8897-79969ddaf5a7]
  • 9. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    As requested....
    Self-contained simple code to demonstrate the problem?
    i'm sending you the sample code with output..
    import java.sql.Date;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.SimpleTimeZone;
    import java.util.TimeZone;
    
    
    public class TimeZoneTest {
        public static void main(String[] args) {
            SimpleDateFormat sdf = new SimpleDateFormat("h:mm a");
    
            sdf.setCalendar(Calendar.getInstance(TimeZone.getTimeZone(TimeZone.getDefault().getID())));
            System.out.println("System Time :" + sdf.format(new Date(System.currentTimeMillis())));
            System.out.println("Default TZ:" + TimeZone.getDefault().getDisplayName(false, 1));
            System.out.println("user.timezone="+System.getProperties().getProperty("user.timezone"));
            System.out.println("OS ="+System.getProperties().getProperty("os.name"));
            System.out.println("Java Version ="+System.getProperties().getProperty("java.version"));
        }
    }
    this the out put in XP system
    System Time :3:40 PM
    Default TZ:India Standard Time
    user.timezone=Asia/Calcutta
    OS =Windows XP
    Java Version =1.3.1
    this is the output in Windows 7
    System Time :10:09 AM
    Default TZ:Greenwich Mean Time
    user.timezone=GMT
    OS =Windows NT (unknown)
    Java Version =1.3.1_01
  • 10. This Thread is now moved
    PhHein Guru Moderator
    Currently Being Moderated
    Note: This thread was originally posted in the [Java Web Start & JNLP|http://forums.sun.com/forum.jspa?forumID=38] forum, but moved to this forum for closer topic alignment.
  • 11. Re: Java Web Start problem in Windows 7
    baftos Expert
    Currently Being Moderated
    Using your code:
    C:\temp>javac TimeZoneTest.java
    
    C:\temp>java TimeZoneTest
    System Time :11:42 AM
    Default TZ:Eastern Standard Time
    user.timezone=America/New_York
    OS =Windows 7
    Java Version =1.6.0_18
    
    C:\temp>
    Note my Java version.
    Your Java is way older than Windows 7.

    Edited by: baftos on Jun 15, 2010 11:44 AM
  • 12. Re: Java Web Start problem in Windows 7
    800268 Expert
    Currently Being Moderated
    Works for me as well:
    Locale :nl_NL
    System Time :8:53 PM
    Default TZ:Central European Time
    user.timezone=Europe/Berlin
    OS =Windows 7
    Java Version =1.6.0_20
  • 13. Re: Java Web Start problem in Windows 7
    793415 Pro
    Currently Being Moderated
    I am getting the same 'null result' as baftos and WalterLaan. But then, my current testing box is neither Win 7 nor IST. I am about to flip over to my Win 7 Netbook, but in the process I wanted to create something 'easy' to point it at. Your code, along with a tweak by WalterLaan, and converted to an applet/application.

    The applet and source is at [http://pscode.org/test/timezonetest/]. I suspect it would be best if we can get results from other people/boxes in the IST zone.

    Edit 1:
    BTW - How closely is this related to your [other query|http://forums.sun.com/thread.jspa?threadID=5442164] about time zones in Java *1.3?*

    If you are looking to support correct time zones for customers running 1.3 JREs, it seems the only option is for them to take up a support contract with Sun, in order to get the latest 1.3 JRE/time zone information. At least by my reading of that thread.

    There comes a time when it is not financially practical to offer support for the older versions.

    Edited by: AndrewThompson64 on Jun 19, 2010 12:38 PM
  • 14. Re: Java Web Start problem in Windows 7
    807580 Newbie
    Currently Being Moderated
    AndrewThompson64 wrote:
    How closely is this related to your [other query|http://forums.sun.com/thread.jspa?threadID=5442164] about time zones in Java *1.3?*
    Both the queries are related to same problem only.

    Thanks a lot AndrewThompson64, baftos and WalterLaan.

    figured out the problem. The source code for the java.util.TimeZone class's getDefault method shows it eventually invokes the sun.util.calendar.ZoneInfo class's getTimeZone method. This method takes a String parameter that is the ID for the required time zone. The default time zone ID is obtained from the user.timezone (System) property. If the user.timezone property is not defined, it tries to get the ID using a combination of the user.country and java.home (System) properties. If it doesn't succeed in finding a time zone ID, it uses a "fallback" GMT value. In other words, if it can't figure out the time zone ID, it uses GMT as your default time zone. JRE 1.3 in windows 7 was working in the same way.

    Did a code change such that user.timezone property is set to IST by using the java.lang.System class's setProperty method.
     System.setProperty("user.timezone","Asia/Calcutta"); 
    This will ensure that application will stick to +5.30 of GMT time zone and is totally independant of the system OS(Widnows XP, Vista, Win 7) and system timezone setting(UTC/GMT). Have created a method to fetch the timezone string value (Asia/Calcutta) from DB. This will make bit more configurable. Tested it. It worked very well in my quality servers.
1 2 Previous Next