macos上VS Code上配置Python、Java、C++环境变量
首先打开设置
然后在搜索框输入set,去编辑settings.json文件
下面是我本机上的配置文件,记录一下。
然后vs code上安装Code Runner插件就可以写cpp、java、py文件去跑了
{
"workbench.colorTheme": "Visual Studio Light - C++",
"auto-close-tag.disableOnLanguage": [
],
// 这里的path填写本机的jdk的位置
"java.configuration.runtimes": [
{
"name": "JavaSE-18",
"path": "/usr/local/java/jdk-18.0.2.jdk/Contents/Home",
"default": true
}
],
"java.showBuildStatusOnStart.enabled": "notification",
"tabnine.experimentalAutoImports": true,
"code-runner.languageIdToFileExtensionMap": {
"bat": ".bat",
"powershell": ".ps1",
"typescript": ".ts"
},
"python.pythonPath": "python3",
// Code Runner执行Python代码(⌘R) //
"code-runner.executorMap": {
"python": "python3",
},
// Whether to save the current file before running.
"code-runner.saveFileBeforeRun": true, // run code前保存
// Whether to save the current file before running.
"code-runner.runInTerminal": true, // 设置成false会在"OUTPUT"中只读输出,无法输入数据
// Whether to preserve focus on code editor after code run is triggered.
"code-runner.preserveFocus": false, // 若为false,run code后光标会聚焦到终端上。如果需要频繁输入数据可设为false
// Whether to clear previous output before each run.
"code-runner.clearPreviousOutput": true, // 每次run code前清空属于code runner的终端消息,默认false
// Whether to ignore selection to always run entire file.
"code-runner.ignoreSelection": false, // 只跑选中的n行代码
"cmake.configureSettings": {
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)