Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] URL as build path entry?

Hi and thanks for your answer.

Well the situation I have is that I have a java project with the sources for a remote runtime. In that java project I do development and debug that remote runtime. The build path of the project should be the same as the class path of the runtime. The classes of the runtime is not accessible as files or folders from the Eclipse java project though. However, the runtime provides access to them via a URL, i.e. as a stream of bytes. If it would have been possible to add that URL to Eclipse it would have been possible to get the class bytes from there instead of from a class file or jar on disk.

Yes you are correct about the URLClassLoader, I used it to do getResourceAsStream() when I tested a bit with getting class bytes (InputStream) from that URL.

I.e.
if remote URL = "" href="http://<remote_url" id="LPlnk611050">http://<remote_url>
then to lookup bytes of class = foo.SomeClass
the following is called http://<remote_url>/foo/SomeClass.class

I.e. in Eclipse such a URL could be used to lookup classes just as if it would have been a file on disk or in a jar. Instead of pre-indexing/caching classes from a URL (as seems to be the case when Eclipse load classes from folders or jars), wouldn't it instead be possible to cache on first access. In my case, since I'm developing and updating the remote runtime with modified classes it would also be good to be able to clear that cache (both entirely or for specific classes), when I deploy a modified class to my runtime.

Perhaps an extension point, to be able to provide custom build path entries (URLs, DB, etc...)?

Regards,
Mikael

 

Från: jdt-dev-bounces@xxxxxxxxxxx <jdt-dev-bounces@xxxxxxxxxxx> för Stephan Herrmann <stephan.herrmann@xxxxxxxxx>
Skickat: den 17 april 2018 18:50
Till: jdt-dev@xxxxxxxxxxx
Ämne: Re: [jdt-dev] URL as build path entry?
 
I haven't heard about any efforts in this direction.
I also doubt that a URLClassLoader is awfully useful for this scenario,
because the compiler doesn't need the Class instance but a .class file,
IOW, not the runtime structure but the byte array as read from disk.
Sure, getResourceAsStream() could be used with some additional leg work ...

But why would that be a relevant use case in the first place?

Stephan

On 17.04.2018 17:52, Mikael Stålhammar wrote:
> Hi
>
> Any chance there is an implementation in the pipe to support having a URL as a build path entry for a java project, to have the
> compiler do remote class lookup via a URLClassLoader? Or is there already support for this in any of the existing Eclipse bundles?
>
>
> Regards,
> Mikael
>
>
> _______________________________________________
> jdt-dev mailing list
> jdt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jdt-dev
>

_______________________________________________
jdt-dev mailing list
jdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-dev

Back to the top