scop / portecle

User friendly GUI application for creating, managing and examining keystores, keys, certificates, certificate requests, certificate revocation lists and more
http://portecle.sourceforge.net/
GNU General Public License v2.0
153 stars 47 forks source link

bc loads wrong JARs #37

Closed scop closed 6 years ago

scop commented 13 years ago

Is it me, is it portecle or is it bouncy castle? I do not know. Using portecle 1.7

I started portecle in through a BAT file setting the JAVA_HOME to C:\Program Files (x86)\Java\jre6 This is the place I patched JCE for string encryption ... It starts up and shows C:\Program Files (x86)\Java\jre6\lib\security\cacaerts as CA key store But when I monitored which JARs are accessed when opening up a PKCS#12 file using strong encryption it accesses the JARs from the system wide JAVA_HOME!

My startup "script" is: set java_home=C:\Program Files (x86)\Java\jre6 set PATH=%PATH%;%JAVA_HOME%\bin start javaw -jar portecle.jar

Reported by: claus-list

scop commented 13 years ago

I don't know if environment variable names are case sensitive on Windows, but I'd suggest using all uppercase JAVA_HOME consistently in your script. Also, you'll probably want to place JAVA_HOME\bin *before* the rest of the things in your PATH. So maybe something like this would work for you:

set JAVA_HOME=C:\Program Files (x86)\Java\jre6 set PATH=%JAVA_HOME%\bin;%PATH% start javaw -jar portecle.jar

This bug report doesn't seem to contain a Portecle bug but just a local system configuration issue, so I'm closing it as invalid.

Original comment by: scop

scop commented 13 years ago

Original comment by: scop

scop commented 13 years ago

Change that knowing that Windows environment variables are not case sensitive. Same result. No local configuration issue. But perhaps some Java bug. It has to do with the way the default class path is handled when run with the -jar option. portecle.jar gets JAVA_HOME correctly seen through the cacert location but jars loaded through the manifests Class-Path: bcprov.jar load other classes through eystem env or registry settings. I guess that neither BC nor portecle would do that. So close it.

Original comment by: claus-list

scop commented 13 years ago

Did you try the other change I suggested, use "set PATH=%JAVA_HOME%\bin;%PATH%" instead of "set PATH=%PATH%;%JAVA_HOME%\bin"?

Original comment by: scop

scop commented 13 years ago

>:o

That changed it thanks! But *why* in heavens sake? There is no reference in the existing PATH to the other (64 Bit) installation of Java ... ??? So it "should" make no difference to be at the beginning or at the end of the PATH ... when parsing the PATH the only difference is the semicolon. I tested that quickly ... does not work either with trailing semicolon.

<astonished>

Original comment by: claus-list