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

Re: [PROPOSAL] New Virtual Packages and way to handle Classpath



> >Can we use $CLASSPATH instead of -classpath?  From my experience making
> >packages work with both free and proprietary JVMs, setting $CLASSPATH
> >before calling the java runtime (instead of passing -classpath, -cp,
> >whatever) has caused the least breakage.
> 
> With some clear idea about *what* you are actually calling, this
> shouldn't be a problem.

I'm really not sure what you mean here.  At the moment, using $CLASSPATH
is somewhat *more* portable across different JVMs than using -classpath.
In particular, it doesn't suffer from the ever-changing command-line
syntax, nor does it override the bootstrap classpath.

> I don't like CLASSPATH, as you have to make
> sure, that it is properly set up and not just gotten from "outside".

Then why push for $JAVA_HOME, which suffers from the same problem?

Btw, what you describe is actually not a problem at all.  If you want
your own specific classpath, in the script you put:

  export CLASSPATH="my/path.jar"             # Clobbers existing classpath

and if you want users to be able to extend your classpath:

  export CLASSPATH="my/path.jar:$CLASSPATH"  # Extends existing classpath

Nothing dangerous here at all.

Ben.



Reply to: