[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: user library problem

"Roger H. Levy" <rhl@xxxxxxx> wrote in message 
news:gorj5j$9mq$1@xxxxxxxxxxxxxxxxxxxx
> Thanks for the response.  I think that if there is any fault with Eclipse 
> it is the fact that within its environment the scenario I described worked 
> both statically in terms of there being no problems identified and 
> dynamically in terms of CTL-F11 causing the app to run as I expected.  I 
> had assumed that if the application structure worked within the 
> environment then I should be able to package the same structure in a jar 
> and expect it to work.

It would work if, instead of packaging the same structure in a jar, you left 
it as a folder of .class files and not-embedded jar files, like it is in 
your bin directory.

An analogy would be that if you created an .exe with a C compiler and 
linker, and tested it, it would work; but if you then packaged it inside a 
zip file and tried to run the zip file, nothing would happen.  A jar file is 
just a zip file with a fancy extension.  The Java VM is smart enough to load 
classes from jars, but not from jars inside jars.

It might be reasonable for Eclipse to put up a warning message if you try to 
package a project that contains an embedded jar file, cautioning that the 
project may no longer be directly runnable by Java.  But the thing is, there 
are also a lot of situations where embedded jar files are perfectly valid; 
for example, the situation where the code knows how to unpack the embedded 
jar file, as is the case for Eclipse plug-in bundles.

So I guess it comes down to how much Eclipse should be a teaching tool: if 
we detect a situation that is valid but unusual or "advanced", should we 
warn?  That's a philosophical question that gets argued back and forth.