I have a jython script which runs successfully using pydev. But the code analysis complains about 'unresolved imports' for the java classes. Is this expected? In other words, does pydev extensions code analysis resolve only jython modules and not java classes? Same question for code completion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, the right answer is that it depends. Pydev should be able to analyze the most common cases successfully, but there can be some cases where things don't go so well (mainly because of the dynamic nature of python).
So, without your particular use-case, it's hard to actually know if it should work for you or not (and have in mind that those are usually exceptions, and there are ways you can help pydev to know about those cases, or at least mark it to ignore those warnings).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, code analysis and completion is working but *only* if I jar up my Java classes and put the jar file on the project pythonpath.
But, previously, I had the folder where these standalone class files exist also on my pythonpath, but in that case, the code analysis complained about unresolved imports. Also (as mentioned previously), PyDev successfully ran my jython script with the non-jar'd classes even though it still complained about the unresolved imports.
So the bottom line: does code analysis and completion depend on the class files being Jar'd? If not, I'll post more details about my (very standard and simple) configuration.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, it should work in the following scenarios: considering you have a java (JDT) project, all you need to do is add that project as a reference in your current project (it doesn't even need a pydev nature in it -- but you need it as a JDT project), otherwise, you really need a jar (just extracted classes in the filesystem won't really work -- sorry about that).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just realized I said something wrong: your referred project must have the pydev config and the pythonpath must contain the bin directory (where jdt creates the .class files).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a single project which has both java nature and python nature (intepreter type set to jython) and their associated builders. I have set the pythonpath property for the project to both the jython source directory AND the output folder for the java classes (and I've confirmed that the .class files are there).
Could the problem be that the java class files are in the same project? It sounds unlikely, but I don't have any other explanation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a jython script which runs successfully using pydev. But the code analysis complains about 'unresolved imports' for the java classes. Is this expected? In other words, does pydev extensions code analysis resolve only jython modules and not java classes? Same question for code completion.
Well, the right answer is that it depends. Pydev should be able to analyze the most common cases successfully, but there can be some cases where things don't go so well (mainly because of the dynamic nature of python).
So, without your particular use-case, it's hard to actually know if it should work for you or not (and have in mind that those are usually exceptions, and there are ways you can help pydev to know about those cases, or at least mark it to ignore those warnings).
Cheers,
Fabio
OK, code analysis and completion is working but *only* if I jar up my Java classes and put the jar file on the project pythonpath.
But, previously, I had the folder where these standalone class files exist also on my pythonpath, but in that case, the code analysis complained about unresolved imports. Also (as mentioned previously), PyDev successfully ran my jython script with the non-jar'd classes even though it still complained about the unresolved imports.
So the bottom line: does code analysis and completion depend on the class files being Jar'd? If not, I'll post more details about my (very standard and simple) configuration.
Thanks.
Sorry for the delay in getting back to you...
Ok, it should work in the following scenarios: considering you have a java (JDT) project, all you need to do is add that project as a reference in your current project (it doesn't even need a pydev nature in it -- but you need it as a JDT project), otherwise, you really need a jar (just extracted classes in the filesystem won't really work -- sorry about that).
Cheers,
Fabio
Oops,
I just realized I said something wrong: your referred project must have the pydev config and the pythonpath must contain the bin directory (where jdt creates the .class files).
Cheers,
Fabio
I have a single project which has both java nature and python nature (intepreter type set to jython) and their associated builders. I have set the pythonpath property for the project to both the jython source directory AND the output folder for the java classes (and I've confirmed that the .class files are there).
Could the problem be that the java class files are in the same project? It sounds unlikely, but I don't have any other explanation.
Yeap, that's it... right now it treats other referred JDT projects, but it doesn't check if the project itself is a JDT/pydev project.
Cheers,
Fabio