Re: I guess I have to violate the license (and I don't feel bad...)
From: Michael Wurm (mwurm_at_sime.com)
Date: 07/23/04
- Next message: Roedy Green: "Re: instanceof vs class"
- Previous message: Will Hartung: "Re: instanceof vs class"
- In reply to: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Next in thread: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Reply: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Jul 2004 16:13:12 -0700
Roedy Green <look-on@mindprod.com.invalid> wrote in message news:<il9tf0l977pjhrpebg8nlgpm5ljbvl3dga@4ax.com>...
> >I have to specify my problem clearly:
> >The classes out of javax.sound.midi I have rewritten are
> >"Sequence" and "Track". I cannot subclass "Track" because the
> >constructor is protected and for some reason I can only call
> >is from inside the package (not even from a subclass outside
> >the package).
> >But for actual playback I use a Sequencer provided by sun,
> >which expects javax.sound.midi.Sequence and
> >javax.sound.midi.Track.
>
> [...]
>
> The constructor being "protected" is GOOD. That means a subclass, even
> in a different package, can access it. If you want to access it from
> other classes, they can still do so via your overriding class.
Now, in this point, I was wrong. Actually it is package-scoped, so no
chance outside of it.
> The second problem is frustrating. You can't insert your code in to
> replace any lower level code, unless there is provided an explicit
> hook for it. This is so easy in some other languages, but in Java is
> considered too dangerous.
>
> I wonder if it would be possible to fool it this way.
> [...]
> Has anyone solved this general problem before?
Yes, I solved it.
But it's illegal to distribute projects using this
technique, and that's my actual problem.
Start java like this:
java -Xbootclasspath/p:myruntime MyApp
In the directory "myruntime" can be a structure like this:
javax/sound/midi/Track.class
javax/sound/midi/Sequence.class
The option -Xbootclasspath/p prepends the specified path (should
also work with a jar-file) to the search pathes for runtime classes.
When loading a RT class, java first searches this directory, and if
there is a class with the required name, it is used. Otherwise java
searches in the default place (rt.jar).
With -Xbootclasspath:myruntime you can completely replace the
default RT.
What does the license say about this?
Excerpt from Sun's license
SUPPLEMENTAL LICENSE TERMS - Section B:
[...] Sun grants you a non-exclusive, non-transferable,
limited license without fees to reproduce and distribute the
Software, provided that [...] (iii)
you do not distribute additional software intended to replace
any component(s) of the Software (unless otherwise specified
in the applicable README file) [...]
>From the documentation of the -Xbootclasspath - option:
Note: Applications that use this option for the purpose of
overriding a class in rt.jar should not be deployed as doing
so would contravene the Java 2 Runtime Environment binary code
license.
- Next message: Roedy Green: "Re: instanceof vs class"
- Previous message: Will Hartung: "Re: instanceof vs class"
- In reply to: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Next in thread: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Reply: Roedy Green: "Re: I guess I have to violate the license (and I don't feel bad...)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|