Execution using javaw differs from Windows 7 default

Discussion in 'Java' started by Gordon Levi, Jul 20, 2012.

  1. Gordon Levi

    Gordon Levi Guest

    I have an application that uses the JDBC-ODBC driver that worked in
    the (Netbeans) IDE but failed to find the (Access) database when using
    the default file association under Windows 7. In the hope of getting
    some more information I ran the application in a command line window
    using javaw and it worked.

    In summary, clicking on a shortcut to "C:\src\myapp\dist\myapp.jar"
    file in Windows 7 failed because it did not find my database although
    it invoked myapp. Clicking on a shortcut to
    "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    works. Can someone explain why?

    In case it is relevant, I did try the jar file's directory and the
    database directory for the "Start in:" directory.
     
    Gordon Levi, Jul 20, 2012
    #1
    1. Advertising

  2. Gordon Levi

    Lew Guest

    Gordon Levi wrote:
    > I have an application that uses the JDBC-ODBC driver that worked in
    > the (Netbeans) IDE but failed to find the (Access) database when using
    > the default file association under Windows 7. In the hope of getting
    > some more information I ran the application in a command line window
    > using javaw and it worked.
    >
    > In summary, clicking on a shortcut to "C:\src\myapp\dist\myapp.jar"
    > file in Windows 7 failed because it did not find my database although
    > it invoked myapp. Clicking on a shortcut to
    > "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    > works. Can someone explain why?
    >
    > In case it is relevant, I did try the jar file's directory and the
    > database directory for the "Start in:" directory.


    Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".

    What exactly is your associated command for JAR files?

    --
    Lew
     
    Lew, Jul 20, 2012
    #2
    1. Advertising

  3. Gordon Levi

    Roedy Green Guest

    Roedy Green, Jul 21, 2012
    #3
  4. Gordon Levi

    Gordon Levi Guest

    Lew <> wrote:

    >Gordon Levi wrote:
    >> I have an application that uses the JDBC-ODBC driver that worked in
    >> the (Netbeans) IDE but failed to find the (Access) database when using
    >> the default file association under Windows 7. In the hope of getting
    >> some more information I ran the application in a command line window
    >> using javaw and it worked.
    >>
    >> In summary, clicking on a shortcut to &quot;C:\src\myapp\dist\myapp.jar&quot;
    >> file in Windows 7 failed because it did not find my database although
    >> it invoked myapp. Clicking on a shortcut to
    >> "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    >> works. Can someone explain why?
    >>
    >> In case it is relevant, I did try the jar file's directory and the
    >> database directory for the "Start in:" directory.

    >
    >Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >
    >What exactly is your associated command for JAR files?


    I think if I knew that "exactly" I might have been able to answer my
    own question. Window 7 shows it as a pretty Java icon with a
    description of "Java(TM) Platform SE binary".
     
    Gordon Levi, Jul 21, 2012
    #4
  5. Gordon Levi

    David Guest

    Roedy Green <> wrote:

    >On Fri, 20 Jul 2012 10:52:14 -0700 (PDT), Lew <>
    >wrote, quoted or indirectly quoted someone who said :
    >
    >>What exactly is your associated command for JAR files?

    >
    >see http://mindprod.com/jgloss/association.html for how to find out.


    That does not seem to answer Lew's question in Windows 7.
     
    David, Jul 21, 2012
    #5
  6. Gordon Levi <> wrote:
    > Lew wrote:
    >> Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >> What exactly is your associated command for JAR files?

    > I think if I knew that "exactly" I might have been able to answer my
    > own question.


    Maybe one needs to check in the registry...
    Does regedit.exe still exist on Windows 7?
    Is the "Execute..." item still in the start-menu?
    (Does the start-menu still exist?)

    I don't really know. I don't have a Windows 7 machine at hand.
     
    Andreas Leitgeb, Jul 21, 2012
    #6
  7. Gordon Levi

    Luuk Guest

    On 21-07-2012 18:11, Gordon Levi wrote:
    > Lew <> wrote:
    >
    >> Gordon Levi wrote:
    >>> I have an application that uses the JDBC-ODBC driver that worked in
    >>> the (Netbeans) IDE but failed to find the (Access) database when using
    >>> the default file association under Windows 7. In the hope of getting
    >>> some more information I ran the application in a command line window
    >>> using javaw and it worked.
    >>>
    >>> In summary, clicking on a shortcut to &quot;C:\src\myapp\dist\myapp.jar&quot;
    >>> file in Windows 7 failed because it did not find my database although
    >>> it invoked myapp. Clicking on a shortcut to
    >>> "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    >>> works. Can someone explain why?
    >>>
    >>> In case it is relevant, I did try the jar file's directory and the
    >>> database directory for the "Start in:" directory.

    >>
    >> Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >>
    >> What exactly is your associated command for JAR files?

    >
    > I think if I knew that "exactly" I might have been able to answer my
    > own question. Window 7 shows it as a pretty Java icon with a
    > description of "Java(TM) Platform SE binary".
    >


    on a comman-prompt try this:
    O:\>assoc .jar
    ..jar=jarfile

    O:\>ftype jarfile
    jarfile="C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

    O:\>

    (after the 'ftype' specify the output of the first command)

    The output of this second line is the command that is executed when you
    double click a jar-file.
    The above output show what will be executed if i do this on MY computer,
    repeat the steps to show what will be executed on YOUR computer.
     
    Luuk, Jul 21, 2012
    #7
  8. Gordon Levi

    Luuk Guest

    On 21-07-2012 18:50, Andreas Leitgeb wrote:
    > Gordon Levi <> wrote:
    >> Lew wrote:
    >>> Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >>> What exactly is your associated command for JAR files?

    >> I think if I knew that "exactly" I might have been able to answer my
    >> own question.

    >
    > Maybe one needs to check in the registry...
    > Does regedit.exe still exist on Windows 7?


    of course, Microsfot won't let that precious tool go!

    > Is the "Execute..." item still in the start-menu?


    not it's called 'Run..' from some time now.. ;)

    > (Does the start-menu still exist?)


    Yeas, how would someone shutdown his computer, i was learned to start
    pressing teh 'start' button for that.... ;)

    >
    > I don't really know. I don't have a Windows 7 machine at hand.
    >


    (sigh)....
     
    Luuk, Jul 21, 2012
    #8
  9. Gordon Levi

    Roedy Green Guest

    On Sun, 22 Jul 2012 02:16:15 +1000, David <>
    wrote, quoted or indirectly quoted someone who said :

    >>>What exactly is your associated command for JAR files?

    >>
    >>see http://mindprod.com/jgloss/association.html for how to find out.

    >
    >That does not seem to answer Lew's question in Windows 7.


    oops. I have updated them to put the more recent methods on top.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    The greatest shortcoming of the human race is our inability to understand the exponential function.
    ~ Dr. Albert A. Bartlett (born: 1923-03-21 age: 89)
    http://www.youtube.com/watch?v=F-QA2rkpBSY
     
    Roedy Green, Jul 22, 2012
    #9
  10. Gordon Levi

    Lew Guest

    Gordon Levi wrote:
    > Lew wrote:
    >> Gordon Levi wrote:
    >>> I have an application that uses the JDBC-ODBC driver that worked in
    >>> the (Netbeans) IDE but failed to find the (Access) database when using
    >>> the default file association under Windows 7. In the hope of getting
    >>> some more information I ran the application in a command line window
    >>> using javaw and it worked.
    >>>
    >>> In summary, clicking on a shortcut to &quot;C:\src\myapp\dist\myapp.jar&quot;
    >>> file in Windows 7 failed because it did not find my database although
    >>> it invoked myapp. Clicking on a shortcut to
    >>> "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    >>> works. Can someone explain why?
    >>>
    >>> In case it is relevant, I did try the jar file's directory and the
    >>> database directory for the "Start in:" directory.

    >>
    >> Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >>
    >> What exactly is your associated command for JAR files?

    >
    > I think if I knew that "exactly" I might have been able to answer my


    Then maybe you should find out and answer it.

    > own question. Window 7 shows it as a pretty Java icon with a
    > description of "Java(TM) Platform SE binary".


    I guess you'd better find out how to determine Windows associations.

    Maybe google it, or ask in a Windows forum.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Jul 22, 2012
    #10
  11. Gordon Levi

    Gordon Levi Guest

    Gordon Levi <> wrote:

    >Lew <> wrote:
    >
    >>Gordon Levi wrote:
    >>> I have an application that uses the JDBC-ODBC driver that worked in
    >>> the (Netbeans) IDE but failed to find the (Access) database when using
    >>> the default file association under Windows 7. In the hope of getting
    >>> some more information I ran the application in a command line window
    >>> using javaw and it worked.
    >>>
    >>> In summary, clicking on a shortcut to &quot;C:\src\myapp\dist\myapp.jar&quot;
    >>> file in Windows 7 failed because it did not find my database although
    >>> it invoked myapp. Clicking on a shortcut to
    >>> "C:\Windows\System32\javaw.exe -jar C:\src\myapp\dist\myapp.jar"
    >>> works. Can someone explain why?
    >>>
    >>> In case it is relevant, I did try the jar file's directory and the
    >>> database directory for the "Start in:" directory.

    >>
    >>Apparently the file association to the JAR files is not "C:\Windows\System32\javaw.exe -jar %1".
    >>
    >>What exactly is your associated command for JAR files?

    >
    >I think if I knew that "exactly" I might have been able to answer my
    >own question. Window 7 shows it as a pretty Java icon with a
    >description of "Java(TM) Platform SE binary".


    I was wrong! I still can't answer my own question. Thanks to "Luuk" I
    now know that the association is
    C:\Program Files (x86)\Java\jre6\bin\javaw.exe "%1" %*

    I am executing C:\Windows\System32\javaw.exe. The two executables are
    definitely different but I don't know the difference.

    A significant omission from my post that was that I am running a 64
    bit version of Windows 7 and I suspect that my lack of understanding
    is because of a some incompatibility between the 32 and 64 bit
    executables and/or drivers.
     
    Gordon Levi, Jul 22, 2012
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Wenz

    javaw ClassNotFoundException

    Christian Wenz, Aug 13, 2003, in forum: Java
    Replies:
    1
    Views:
    406
    Roedy Green
    Aug 14, 2003
  2. SAP BASIS Consultant
    Replies:
    1
    Views:
    1,829
    icebattle
    Nov 14, 2003
  3. javaw.exe

    , Dec 16, 2003, in forum: Java
    Replies:
    3
    Views:
    472
    Chris Smith
    Dec 16, 2003
  4. Christian Marko
    Replies:
    0
    Views:
    477
    Christian Marko
    Sep 21, 2004
  5. Zeguudo Zegudissimo
    Replies:
    4
    Views:
    497
    Zeguudo Zegudissimo
    Sep 2, 2010
Loading...

Share This Page