Opened 13 years ago

Closed 13 years ago

#40 closed defect (fixed)

Can't find Jar file in default dir.

Reported by: Yoda_Java6 Owned by:
Priority: critical Milestone: Beta 2
Component: general Version:
Severity: Keywords:
Cc: Yoda_Java6

Description

I try to start a Java app this way:
java.exe -jar jeti2.jar

(Jeti2.jar is in cur. dir)

Result:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.io.FileNotFoundException?: Jeti2.jar (File not fo
und)

at java.util.zip.ZipFile?.open(Native Method)
at java.util.zip.ZipFile?.<init>(ZipFile?.java:131)
at java.util.jar.JarFile?.<init>(JarFile?.java:150)
at java.util.jar.JarFile?.<init>(JarFile?.java:87)

If I start it like:
Java.exe -jar K:\java1\jeti2\Jeti2.jar
App loads, but then fails l8r with some other problem.

Looks like this Java 6 switches away from curdir,
when it starts, and then can't find the app.

No earlier versions (1.31 1.41 1.42) shows this behavior,
when started same way.

Attachments (1)

hs_err_pid217.log (18.9 KB) - added by Yoda_Java6 13 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 13 years ago by Yoda_Java6

After a little more testing......

My JAVA6 is installed on L: and app was installed on K:
After moving app to K: Java can suddanly find the jar file.

Java clearly has a problem with driveletters.

comment:2 Changed 13 years ago by Yoda_Java6

UPS

I meant .... after moving app to _L:_

comment:3 Changed 13 years ago by dmik

Nothing like that here. Perfectly strarted Font2DTest.jar from drive C: while OpenJDK is on D: (both drives are HPFS, vanilla eCS 2.0). Please try to collect more details.

comment:4 Changed 13 years ago by dmik

Also tried to place the .jar to an NDFS (SMB) share, works too.

comment:5 Changed 13 years ago by Tellie

Hi
I get when trying jeti.
[S:\Jeti]C:\PROGRAMS\Java6\bin\java.exe -jar s:\jeti\jeti2-inst.jar
SYS1808:
The process has stopped. The software diagnostic
code (exception code) is 0005.

If i don't use the s:\jeti\jeti2-inst.jar but just jeti2-inst.jar i get:

S:\Jeti>C:\PROGRAMS\Java6\jre\bin\java.exe -jar jeti2-inst.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.io.FileNotFoundException?: jeti2-inst.jar (File not found)

at java.util.zip.ZipFile?.open(Native Method)
at java.util.zip.ZipFile?.<init>(ZipFile?.java:131)
at java.util.jar.JarFile?.<init>(JarFile?.java:150)
at java.util.jar.JarFile?.<init>(JarFile?.java:87)

Wish you all the best for 2011 :)

Changed 13 years ago by Yoda_Java6

Attachment: hs_err_pid217.log added

comment:6 in reply to:  5 Changed 13 years ago by Yoda_Java6

Cc: Yoda_Java6 added

Replying to Tellie:

Hi
I get when trying jeti.
[S:\Jeti]C:\PROGRAMS\Java6\bin\java.exe -jar s:\jeti\jeti2-inst.jar
SYS1808:
The process has stopped. The software diagnostic
code (exception code) is 0005.

I see the same here, when doing so.
I'm attaching the log for this.

comment:7 in reply to:  3 Changed 13 years ago by Yoda_Java6

Replying to dmik:

Nothing like that here. Perfectly strarted Font2DTest.jar from drive C: while OpenJDK > is on D: (both drives are HPFS, vanilla eCS 2.0). Please try to collect more details.

I tried same app. Copied it from L: where Java6 is, to K: , and then ran this script:
SET JAVA_HOME=L:\Java6
Set PATH=L:\Java6\bin;%PATH%
SET BEGINLIBPATH=L:\Java6\bin;
SET CLASSPATH=
SET SWING_HOME=
%JAVA_HOME%\bin\java.exe -jar Font2DTest.jar

Result:

[eCS]─┼── K:\Font2DTest(0)> L:\Java6\bin\java.exe -jar Font2DTest.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.io.FileNotFoundException?: Font2DTest.jar (File n
ot found)

at java.util.zip.ZipFile?.open(Native Method)
at java.util.zip.ZipFile?.<init>(ZipFile?.java:131)
at java.util.jar.JarFile?.<init>(JarFile?.java:150)
at java.util.jar.JarFile?.<init>(JarFile?.java:87)

[eCS]─┼── K:\Font2DTest(0)>

comment:8 in reply to:  3 Changed 13 years ago by Yoda_Java6

Priority: majorcritical

Replying to dmik:

Nothing like that here. Perfectly strarted Font2DTest.jar from drive C:
while OpenJDK is on D: (both drives are HPFS, vanilla eCS 2.0). Please try to
collect more details.

I think you forgot to check Theseus.

I can reproduce your scenario here. I put same test app in a dir on Java drive,
and in same named dir on another partition. Start and close the first - then the second. Now the second works - but if you check Theseus - it is the Jar files from the Java partition, that is actually loaded - not the one from the other.

comment:9 Changed 13 years ago by Tapio_Angervuori

I have the same problem: the program does not find any kind of files from the start-up directory!

comment:10 Changed 13 years ago by Silvan Scherrer

i tried your scenarios as well, but for me it works. i start the app with the following script:

'set JDK=d:\programs\java6' /* should be full path to this directory */

'set JAVA_HOME='
'set PATH=%JDK%\bin;%PATH%'
'set BEGINLIBPATH=%JDK%\bin;%BEGINLIBPATH%'

comment:11 in reply to:  10 Changed 13 years ago by Yoda_Java6

Replying to diver:

i tried your scenarios as well, but for me it works.

Works ?

You checked with Theseus, that you actually ran, what you thought you ran ?

i start the app with the following script:

'set JDK=d:\programs\java6' /* should be full path to this directory */

What does 'SET JDK' Do ? No such thing have ever been used on OS/2, and there
is no documentation for such a setting in the release.

'set JAVA_HOME='
'set PATH=%JDK%\bin;%PATH%'
'set BEGINLIBPATH=%JDK%\bin;%BEGINLIBPATH%'


What on earth is that supposed to do, besides trying to kill the system ?

comment:12 Changed 13 years ago by Yoda_Java6

System seems to reformat msgs a bit too much.
last comment should have been (hopefully) like this:

'set BEGINLIBPATH=%JDK%\bin;%BEGINLIBPATH%'


(not sure arrows are here, so I change comment..:)
What on earth is the last %BEGINLIBPATH% supposed to do, besides trying to kill the system ?

Neither LIBPATH nor BEGINLIBPATH nor ENDLIBPATH are ENV VARS, so result of %anyofthem% = (null)

comment:13 Changed 13 years ago by dmik

Please don't be silly. BEGINLIBPATH/ENDLIBPATH are not environment variables but CMD.EXE emulates the variable-like behavior for them. You could at least check it yourself.

comment:14 Changed 13 years ago by dmik

What about the rest, I confirm the bug. Thank you for your findings. Turned out to be hiding really well. Looks like Java always uses the CWD of its own drive instead of the current drive when resolving the relative paths (so that it works if the .jar is in both its own CWD and in the real CWD). I have a guess where the problem is.

comment:15 Changed 13 years ago by dmik

Milestone: GABeta 2
Resolution: fixed
Status: newclosed

This turned to be a bug in LIBC (http://svn.netlabs.org/libc/ticket/237). I fixed it in Odin (MINIVCRT) since I already intercept _fullpath() there.

Note: See TracTickets for help on using tickets.