[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: error starting java .jar app - classpath issue?



On 28.10.05 08:01:40, Gordon Pedersen wrote:
> On Fri, Oct 28, 2005 at 12:09:42PM +0200, Andreas Pakulat wrote:
> > On 27.10.05 20:55:41, Gordon Pedersen wrote:
> > Hmm, if I'm correct, the constructor of ImageIcon is called with a
> > relative path for the Image file, for example "example.gif". Now when
> > you're not in the directory where example.gif lies, this might result in
> > such an error. However, ImageIcon should probably check wether the file
> > actually exists and not rely on it to be there...
> 
> It is possible that you're right.  Seems odd though in a product
> several years old and probably in the hands of thousands (I
> can't say), that everyone is habitually setting their working directory to
> the app dir before invoking.  

Well, if you use that thing on windows what you typically do is
double-click onto the file -> working dir is app dir. On linux the
situation might be similar, or do you want to always type a long path?
;-)

> > However: I did not check the source of ImageIcon and thus cannot say for
> > sure what is "missing" at that point in the constructor...
> 
> I don't know how to check source on the official java library code.

Sun's jdk has the source for most classes in the src.zip file. For free
implementations you should be able to do a apt-get source <java-package>

> > > I wonder if it may just be a matter of learning how to correctly
> > > set the CLASSPATH before issuing the java command on .jar
> > > libraries held in /usr/share/java/. 
> > 
> > The problem is not the classpath, but the code in TimeTracker, it
> > assumes that you run the jar-file from the directory where the images
> > lie. That is, if my assumption about a file-not-found problem is
> > correct.
> 
> Is there a way to find something out by inspecting the tt.jar file?

Is that thing not available as source code? If not: There are ways to
get to the source code from the byte-code, however I think that might be
illegal depending on the license of the program. 

Andreas

-- 
You plan things that you do not even attempt because of your extreme caution.



Reply to: