Execution using javaw differs from Windows 7 default

G

Gordon Levi

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.
 
L

Lew

Gordon said:
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?
 
G

Gordon Levi

Lew said:
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".
 
A

Andreas Leitgeb

Gordon Levi said:
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.
 
L

Luuk

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.
 
L

Luuk

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)....
 
R

Roedy Green

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)
 
L

Lew

Gordon said:
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.
 
G

Gordon Levi

Gordon Levi said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top