aspose file tools*
The moose likes Java in General and the fly likes Package at multiple locations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Package at multiple locations" Watch "Package at multiple locations" New topic
Author

Package at multiple locations

Mikael Rundqvist
Greenhorn

Joined: Sep 18, 2001
Posts: 7
Hi,
I am having a bit of a problem when running a product called jess (Java Expert System Shell). Jess comes as a jar-file to be included in your classpath. I decided to place it in c:\Program Files\Jess60a8\. I have also installed a product called JessWin which comes as source code. I have compiled this product and placed it in c:\Program Files\JessWin1.13.
Together with those products I have a rather big application called NAM (AXE Number Analysis Management). This product is built up by multiple jar-files all placed in the lib-directory of the application home directory (C:\Program Files\AXE Number Analysis Manager\) e.g. c:\Program Files\AXE Number Analysis Manager\lib.
I have made alterations and additions to some of the NAM code and placed all output class-files under h:\work\pernilla\...
What I want is to shadow the original class files with the ones coded by me and placed as described above in h:\work\pernilla\.
To achieve this I have created a bat file with the following command:
javaw -classpath "H:\work\pernilla\;c:\Program Files\JessWin1.13\;c:\Program Files\Jess60a8\jess.jar;c:\Program Files\AXE Number Analysis Manager\lib\axenam.jar;c:\Program Files\AXE Number Analysis Manager\lib\flexlm.jar;c:\Program Files\AXE Number Analysis Manager\lib\vbjorb.jar;c:\Program Files\AXE Number Analysis Manager\lib\jctable450K.jar;c:\Program Files\AXE Number Analysis Manager\lib\sfc.jar;c:\Program Files\AXE Number Analysis Manager\lib\jhall.jar;c:\Program Files\AXE Number Analysis Manager\lib\jaxp.jar;c:\Program Files\AXE Number Analysis Manager\lib\parser.jar;c:\Program Files\AXE Number Analysis Manager\lib\mml.jar;c:\Program Files\AXE Number Analysis Manager\lib\jndi.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_cs.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_dsa.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_ls.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_nsa.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_sm.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_smssr.jar;c:\Program Files\AXE Number Analysis Manager\lib\pcsall.jar;." JessWin
To say that the classpath gets long is an understatement.
Some packages can now be found in two places:
a. Under H:\work\pernilla\
b. in c:\Program Files\AXE Number Analysis Manager\axenam.jar
In both H:\work\pernilla\ and in the jar-file there is a deep package structure named "SE.ericsson.epk.NAM".
When i run the bat-file I get the JessWin GUI and the Jess clips system (a knowledgebased system) up and running.
From Jess it is possible to create instances of classes through a lisp-like language called clips.
Here's where my problem start:
1. I have created new classes in a package under H:work\pernilla with the same package hierarchy that exists in axenam.jar. Those classes cannot be loaded by the system class loader.
2. I am able to start the NAM-application from JessWin clips-prompt but when I do so only the classes in axenam.jar are found.
I have e.g. made additions to the GUI and this is not shown.
I have printed the "java.class.path" property from the Jess prompt through the command:
(printout t (call System getProperty "java.class.path"))
and get the following output
H:\work\pernilla\;c:\Program Files\JessWin1.13\;c:\Program Files\Jess60a8\jess.jar;c:\Program Files\AXE Number Analysis Manager\lib\axenam.jar;c:\Program Files\AXE Number Analysis Manager\lib\flexlm.jar;c:\Program Files\AXE Number Analysis Manager\lib\vbjorb.jar;c:\Program Files\AXE Number Analysis Manager\lib\jctable450K.jar;c:\Program Files\AXE Number Analysis Manager\lib\sfc.jar;c:\Program Files\AXE Number Analysis Manager\lib\jhall.jar;c:\Program Files\AXE Number Analysis Manager\lib\jaxp.jar;c:\Program Files\AXE Number Analysis Manager\lib\parser.jar;c:\Program Files\AXE Number Analysis Manager\lib\mml.jar;c:\Program Files\AXE Number Analysis Manager\lib\jndi.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_cs.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_dsa.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_ls.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_nsa.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_sm.jar;c:\Program Files\AXE Number Analysis Manager\lib\nms_cif_smssr.jar;c:\Program Files\AXE Number Analysis Manager\lib\pcsall.jar;.
This seems to be all good and well but as described above classes under H:\work\pernilla\... simply can't be found.
Is there any limitations to the length of the classpath property?
If so shouldn't that instead cause things further down the classpath being unavaible not those classes placed under packages in h:\work\pernilla?
I know this is rather intricate problem but I hope for help from interrested readers of this forum.
Mikael Rundqvist
Greenhorn

Joined: Sep 18, 2001
Posts: 7
I have found the problem myself. I exchanged where the directory of the source files and of the class files. My path should be H:\work\pernilla\exec\
Yet another example of the saying:
"Always, always get your classpath right otherwise you can't sleep at night"
The question still remains about a max length of classpath.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Package at multiple locations