Demos from JavaHelp are not running well without modifications.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Geert_Vancompernolle
Posted On:   Tuesday, August 21, 2001 12:54 AM

Hello I've downloaded the complete JavaHelp stuff and installed it on my PC in a folder called 'C:WinAppsjh1.1' In this folder, there's a subdirectory called 'demos', in which one can find the sources of some example applications. The one I'm especially interested in, is the 'idedemo' example application. I don't have problems compiling the file 'ApiDemo.java', which is located in the directory 'C:WinAppsjh1.1demossrcsunwdemoidedemo' (this is the location on my PC). But when I run this application without modifications, I always get the following error: 'Help Set IdeHelp not found'. If I look where the file 'IdeHelp.hs' is located, I can find it in the following directory:   More>>

Hello


I've downloaded the complete JavaHelp stuff and installed it on my PC in a folder called 'C:WinAppsjh1.1'


In this folder, there's a subdirectory called 'demos', in which one can find the sources of some example applications. The one I'm especially interested in, is the 'idedemo' example application.


I don't have problems compiling the file 'ApiDemo.java', which is located in the directory 'C:WinAppsjh1.1demossrcsunwdemoidedemo' (this is the location on my PC). But when I run this application without modifications, I always get the following
error: 'Help Set IdeHelp not found'.


If I look where the file 'IdeHelp.hs' is located, I can find it in the following directory: 'C:WinAppsjh1.1demoshsidehelp'. However, in the source code, only 'IdeHelp' is filled in in the variable 'helpsetName' (of type String).


If I look to the constructor 'ApiDemo', there's a classloader used in the very beginning to determine where the application has been started:


ClassLoader cl = ApiDemo.class.getClassLoader();


Does this method takes into account the fact that the 'real' java file is located in the package 'sunw.demo.idedemo'? In other words: is the starting directory 'C:WinAppsjh1.1demossrcsunwdemoidedemo' or 'C:WinAppsjh1.1demossrc'? This is not clear to me...


After that, a url is determined:


URL url = HelpSet.findHelpSet( cl, helpsetName );


However, when the program runs, the url is always 'null', because the application cannot find the location of the file 'IdeHelp.hs'. Therefore, the following command throws an exception:


mainHS = new HelpSet( cl, url );


Whatever I do, I can't find a solution to tell the application it has to search in a certain directory. Since I don't want to have a fixed path in my code, I would like to use the classloader and also the correct creation of the URL, as given in the example.


Using "../hs/idedemo/IdeDemo.hs" as a string for 'helpsetName' doesn't solve the issue, although I hoped it would...


Can someone have a look into this demo and try to run it for him/herself without modifications? Can someone give me the solution to this problem too, taken into account I don't want to code a fixed location for my .hs file?


Any help is highly appreciated.


Thanks in advance,


Geert

   <<Less
About | Sitemap | Contact