Issue2107

classification
Title: Support Contextual Classpath Determination
Type: rfe Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eaaltonen, zyasoft
Priority: low Keywords:

Created on 2013-12-19.13:06:16 by eaaltonen, last changed 2015-04-30.13:47:20 by eaaltonen.

Files
File name Uploaded Description Edit Remove
runjython eaaltonen, 2013-12-19.13:19:23
Messages
msg8205 (view) Author: (eaaltonen) Date: 2013-12-19.13:19:23
This is about supporting multiple applications which have a different CLASSPATH, essentially giving everyone their individual namespace.

I have a shell scripting based implementation which may better explain what I am proposing.

Suppose we have two applications: a and b.

$ ls -R *
a:
a.py  setclasspath.sh

b:
b.py  setclasspath.sh


In linux you can specify the interpreter, for example you can start a.py with
#!/usr/bin/env jython

which is awfully convenient, since you can then run you jython script by simply calling it:
$ ./a.py

The attached 'runjython' script acts like the jython interpreter, but will first call setclasspath.sh, setting the classpath for the current application.

This of course only works on linux, but demonstrates the aim of having separate 'classpath namespaces'. It also combines very nicely with IPython.
msg9167 (view) Author: (eaaltonen) Date: 2014-10-24.07:41:20
After experementing with this recently, I think the conxtextual behaviour should be as follows

if (passed a script as an argument):
    trySetClassPathBasedOnLocation(script)
else:
    trySetClassPathBasedOnLocation(current_working_directory)
msg9993 (view) Author: (eaaltonen) Date: 2015-04-30.13:47:19
Now that Windows has a native launcher, I wonder if this classpath creation could be included in the startup phase.

My current solution works both in linux and in Windows Git Bash, but not on "general windows systems".

If cpython is invoked during the startup, the appropriate classpath could maybe constructed in a setclasspath.py script.
History
Date User Action Args
2015-04-30 13:47:20eaaltonensetmessages: + msg9993
2014-10-24 07:41:22eaaltonensetmessages: + msg9167
2014-09-24 18:32:57zyasoftsetpriority: low
2014-07-11 16:21:54zyasoftsetnosy: + zyasoft
2013-12-19 13:19:23eaaltonensetfiles: + runjython
messages: + msg8205
2013-12-19 13:06:16eaaltonencreate