| View previous topic :: View next topic |
| Author |
Message |
gbruno Guest
|
Posted: Tue Jun 14, 2005 6:49 am Post subject: Windows Registry from java ... ExceptionInInitializerErro |
|
|
With jbuilder2005 I can use jst from
http://www.steffensiebert.de/soft/jst/
to access the Windows Registry
BUT when I make a jar
I get
Exception in thread "AWT-EventQueue-0"
java.lang.ExceptionInInitializerError
at
com.jobjects.jst.win32.Win32RegManager.getTopLevelRegistryKey(Win32RegManager.java:51)
at
com.jobjects.jst.win32.Win32RegManager.openRegistryKey(Win32RegManager.java:56)
at w21menu.Frama.RegistryTest(Frama.java:434)
......
So it works in the IDE but not from the stand-alone jar
1)What should I be including in the jar
(I have added jst.jar and everything from the jst library)
is this maybe a securitymanager problem?
(the stack trace does not mention security)
2) is there a better way to access registry?
[all I need is the full path for the pdf viewer]
cheers
gbruno
|
|
| Back to top |
|
 |
gbruno Guest
|
Posted: Wed Jun 15, 2005 4:37 am Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr |
|
|
IDE vs commandline
when I run in IDE (JBX) and use System.getProperties
I get a very big java.class.path
when I run on a commandline java -jar fred.jar
and I look at System.getProperties
I get java.class.path = fred.jar
Despite any setting of Environment variables (win2k)
This is
1) absurd
2) annoying
3) farcical
How many hundreds of thousands of people have tried java, said "this
classpath stuff is jive" and never returned?
Why wasn't the guy who suggested classpath quietly taken out the back
of Sun HQ and shot in the head?
|
|
| Back to top |
|
 |
gbruno Guest
|
Posted: Wed Jun 15, 2005 5:11 am Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr |
|
|
at
http://www.codecomments.com/showthread.php?s=&postid=1730701#post1730701
someone has the same problem
Lori Olson [TeamB] admits that jar classpath is a crock
John McGrath [TeamB] admits its a bug
there appears to be no solution...
at least for native/dll/exe a jar may well not work
- you can stuff all the DLLs into the jar but it wont fly.
|
|
| Back to top |
|
 |
gbruno Guest
|
Posted: Wed Jun 15, 2005 5:39 am Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr |
|
|
and the solution is:
cmdline = "cmd /c start " + pdfname;
Process p = Runtime.getRuntime().exec(cmdline);
thanks
http://forum.java.sun.com/thread.jspa?threadID=608906&tstart=135
forget about registry, jni dll none of them are necessary
I knew that..... I merely neglected the "cmd"
now to try it in wind98...
|
|
| Back to top |
|
 |
|