|
|
e4909f6 |
diff --git a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java
|
|
|
e4909f6 |
index 86f83ef..14cdc34 100644
|
|
|
e4909f6 |
--- a/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java
|
|
|
e4909f6 |
+++ b/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java
|
|
|
10a1404 |
@@ -688,6 +688,9 @@
|
|
|
e4909f6 |
throw new RuntimeException("The jython jar must be specified as the interpreter to run. Found: "
|
|
|
e4909f6 |
+ interpreter);
|
|
|
e4909f6 |
}
|
|
|
e4909f6 |
+ if (interpreter.toOSString().endsWith("jython")) {
|
|
|
e4909f6 |
+ cmdArgs.add(interpreter.toOSString());
|
|
|
e4909f6 |
+ } else {
|
|
|
10a1404 |
cmdArgs.add(javaLoc);
|
|
|
e4909f6 |
|
|
|
10a1404 |
//some nice things on the classpath config: http://mindprod.com/jgloss/classpath.html
|
|
|
10a1404 |
@@ -703,6 +706,7 @@
|
|
|
10a1404 |
cpath = interpreter + SimpleRunner.getPythonPathSeparator() + pythonpathUsed;
|
|
|
10a1404 |
// }
|
|
|
10a1404 |
cmdArgs.add(cpath);
|
|
|
e4909f6 |
+ }
|
|
|
e4909f6 |
cmdArgs.add("-Dpython.path=" + pythonpathUsed); //will be added to the env variables in the run (check if this works on all platforms...)
|
|
|
e4909f6 |
|
|
|
e4909f6 |
addVmArgs(cmdArgs);
|
|
|
10a1404 |
@@ -714,8 +718,14 @@
|
|
|
10a1404 |
//cmdArgs.add("-Dpython.security.respectJavaAccessibility=false");
|
|
|
e4909f6 |
|
|
|
a8c7137 |
cmdArgs.add("org.python.util.jython");
|
|
|
e4909f6 |
+ if (!interpreter.toOSString().endsWith("jython")) {
|
|
|
e4909f6 |
+ cmdArgs.add("org.python.util.jython");
|
|
|
e4909f6 |
+ }
|
|
|
a8c7137 |
addDebugArgs(cmdArgs, "jython", actualRun, addWithDashMFlag, modName);
|
|
|
e4909f6 |
} else {
|
|
|
10a1404 |
+ if (!interpreter.toOSString().endsWith("jython")) {
|
|
|
10a1404 |
+ cmdArgs.add("org.python.util.jython");
|
|
|
10a1404 |
+ }
|
|
|
a8c7137 |
cmdArgs.add("org.python.util.jython");
|
|
|
e4909f6 |
}
|
|
|
e4909f6 |
|
|
|
9dcbece |
diff --git a/plugins/org.python.pydev/src/org/python/pydev/runners/SimpleJythonRunner.java b/plugins/org.python.pydev/src/org/python/pydev/runners/SimpleJythonRunner.java
|
|
|
e4909f6 |
index 1b3d84c..6214e08 100644
|
|
|
9dcbece |
--- a/plugins/org.python.pydev/src/org/python/pydev/runners/SimpleJythonRunner.java
|
|
|
9dcbece |
+++ b/plugins/org.python.pydev/src/org/python/pydev/runners/SimpleJythonRunner.java
|
|
|
9dcbece |
@@ -74,19 +74,24 @@ public class SimpleJythonRunner extends SimpleRunner {
|
|
|
9dcbece |
String javaLoc = javaExecutable.getCanonicalPath();
|
|
|
9dcbece |
String[] s;
|
|
|
9dcbece |
|
|
|
9dcbece |
- //In Jython 2.5b0, if we don't set python.home, it won't be able to calculate the correct PYTHONPATH
|
|
|
9dcbece |
- //(see http://bugs.jython.org/issue1214 )
|
|
|
9dcbece |
-
|
|
|
9dcbece |
- String pythonHome = new File(jythonJar).getParent().toString();
|
|
|
9dcbece |
-
|
|
|
9dcbece |
- if (additionalPythonpath != null) {
|
|
|
9dcbece |
- jythonJar += SimpleRunner.getPythonPathSeparator();
|
|
|
9dcbece |
- jythonJar += additionalPythonpath;
|
|
|
9dcbece |
- s = new String[] { javaLoc, "-Dpython.path=" + additionalPythonpath, "-Dpython.home=" + pythonHome,
|
|
|
9dcbece |
- "-classpath", jythonJar, "org.python.util.jython", script };
|
|
|
9dcbece |
+ if (new File(jythonJar).getName().equals("jython")) {
|
|
|
9dcbece |
+ //The system jython can simply be invoked directly
|
|
|
9dcbece |
+ s = new String[] { jythonJar, script };
|
|
|
9dcbece |
} else {
|
|
|
9dcbece |
- s = new String[] { javaLoc, "-Dpython.home=" + pythonHome, "-classpath", jythonJar,
|
|
|
9dcbece |
- "org.python.util.jython", script };
|
|
|
9dcbece |
+ //In Jython 2.5b0, if we don't set python.home, it won't be able to calculate the correct PYTHONPATH
|
|
|
9dcbece |
+ //(see http://bugs.jython.org/issue1214 )
|
|
|
9dcbece |
+
|
|
|
9dcbece |
+ String pythonHome = new File(jythonJar).getParent().toString();
|
|
|
9dcbece |
+
|
|
|
9dcbece |
+ if (additionalPythonpath != null) {
|
|
|
9dcbece |
+ jythonJar += SimpleRunner.getPythonPathSeparator();
|
|
|
9dcbece |
+ jythonJar += additionalPythonpath;
|
|
|
9dcbece |
+ s = new String[] { javaLoc, "-Dpython.path=" + additionalPythonpath, "-Dpython.home=" + pythonHome,
|
|
|
9dcbece |
+ "-classpath", jythonJar, "org.python.util.jython", script };
|
|
|
9dcbece |
+ } else {
|
|
|
9dcbece |
+ s = new String[] { javaLoc, "-Dpython.home=" + pythonHome, "-classpath", jythonJar,
|
|
|
9dcbece |
+ "org.python.util.jython", script };
|
|
|
9dcbece |
+ }
|
|
|
9dcbece |
}
|
|
|
9dcbece |
|
|
|
9dcbece |
if (args != null && args.length > 0) {
|
|
|
e4909f6 |
@@ -158,6 +163,19 @@ public class SimpleJythonRunner extends SimpleRunner {
|
|
|
e4909f6 |
cacheDir = "-Dpython.cachedir=" + cacheDir.trim();
|
|
|
e4909f6 |
}
|
|
|
e4909f6 |
|
|
|
e4909f6 |
+ if (new File(jythonJar).getName().equals("jython")) {
|
|
|
e4909f6 |
+ //The system jython can simply be invoked directly
|
|
|
e4909f6 |
+ List<String> asList = new ArrayList<String>();
|
|
|
e4909f6 |
+ asList.add(jythonJar);
|
|
|
e4909f6 |
+ if (cacheDir != null) {
|
|
|
e4909f6 |
+ asList.add(cacheDir);
|
|
|
e4909f6 |
+ }
|
|
|
e4909f6 |
+ asList.add("-Dpython.path=" + jythonPath.toString());
|
|
|
e4909f6 |
+ asList.addAll(Arrays.asList(script));
|
|
|
e4909f6 |
+ asList.addAll(Arrays.asList(args));
|
|
|
e4909f6 |
+ return asList.toArray(new String[0]);
|
|
|
e4909f6 |
+ }
|
|
|
e4909f6 |
+
|
|
|
e4909f6 |
String[] vmArgsList = ProcessUtils.parseArguments(vmArgs);
|
|
|
e4909f6 |
String[] s = new String[] {
|
|
|
e4909f6 |
"-Dpython.path=" + jythonPath.toString(),
|
|
|
9dcbece |
diff --git a/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java b/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java
|
|
|
e4909f6 |
index 9bd8d88..48ea995 100644
|
|
|
9dcbece |
--- a/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java
|
|
|
9dcbece |
+++ b/plugins/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java
|
|
|
e4909f6 |
@@ -1457,9 +1457,9 @@ public class InterpreterInfo implements IInterpreterInfo {
|
|
|
9dcbece |
*/
|
|
|
9dcbece |
public static boolean isJythonExecutable(String executable) {
|
|
|
9dcbece |
if (executable.endsWith("\"")) {
|
|
|
9dcbece |
- return executable.endsWith(".jar\"");
|
|
|
9dcbece |
+ return executable.endsWith(".jar\"") || executable.endsWith("jython\"");
|
|
|
9dcbece |
}
|
|
|
9dcbece |
- return executable.endsWith(".jar");
|
|
|
9dcbece |
+ return executable.endsWith(".jar") || executable.endsWith("jython");
|
|
|
9dcbece |
}
|
|
|
9dcbece |
|
|
|
9dcbece |
/**
|