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

Asked by zhenya

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:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
zhenya
Solved:
Last query:
Last reply:
Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
zhenya (zhenya.kozhevnikov) said :
#3

issue solved