How to set up sikulixapi.jar as an environment variable in Visual Studio Code?

Asked by zhenya on 2020-07-31

Probably it may be considered that this question boils down to simply "How to set up environment variable in VS Code?" question.
But I think that in context of writing scripts for sikulix in (for example) Jython it is a pretty specific case. Because it's about using Java implementations of other languages together with referencing to jar files.

Previously I was using Atom which has such feature as "profile", so you can configure it and then run your code with particular profile. Configuration for my profile was as follows:
"Command": "C:\jython2.7.0\bin\jython",
"Environment Variables": "CLASSPATH=C:/users/zhenya/downloads/sikulixapi.jar"

How to make same reference to "sikulixapi.jar" in VS Code?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
zhenya
Solved:
2020-08-06
Last query:
2020-08-06
Last reply:
2020-07-31
RaiMan (raimund-hocke) said : #1

No experience and surely not a special SikuliX question.

The question must be: Can VS Code be configured to edit an run Python scripts?

zhenya (zhenya.kozhevnikov) said : #2

I've figured this out.
Environment variable reference to siculixapi.jar may be done inside workspace settings file.
My example of this setup is as follows:

{
 "folders": [
  {
   "path": "javaSikuli\\javaSikulixTest"
  }
 ],
 "settings": {
  "java.project.referencedLibraries": [
   "lib/**/sikulixapi-2.0.4.jar",
   "C:\\automation\\javaSikulixTest\\lib\\sikulixapi-2.0.4.jar"
  ]
 }
}

Just remember to escape backslash character in file address the way it's done here.

zhenya (zhenya.kozhevnikov) said : #3

issue solved