BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Windows Registry from java ... ExceptionInInitializerErro

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE
View previous topic :: View next topic  
Author Message
gbruno
Guest





PostPosted: Tue Jun 14, 2005 6:49 am    Post subject: Windows Registry from java ... ExceptionInInitializerErro Reply with quote



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





PostPosted: Wed Jun 15, 2005 4:37 am    Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr Reply with quote



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





PostPosted: Wed Jun 15, 2005 5:11 am    Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr Reply with quote



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





PostPosted: Wed Jun 15, 2005 5:39 am    Post subject: Re: Windows Registry from java ... ExceptionInInitializerErr Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.