当前位置: 首页>>代码示例>>Java>>正文


Java PathEnvironmentVariableUtil.findInPath方法代码示例

本文整理汇总了Java中com.intellij.execution.configurations.PathEnvironmentVariableUtil.findInPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathEnvironmentVariableUtil.findInPath方法的具体用法?Java PathEnvironmentVariableUtil.findInPath怎么用?Java PathEnvironmentVariableUtil.findInPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.configurations.PathEnvironmentVariableUtil的用法示例。


在下文中一共展示了PathEnvironmentVariableUtil.findInPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@NotNull
protected static String findExecutable(@NotNull String programName,
                                       @NotNull String unixExec,
                                       @NotNull String winExec,
                                       @NotNull Collection<String> envs) {
  String exec = findEnvValue(programName, envs);
  if (exec != null) {
    return exec;
  }
  File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
  if (fileExec != null) {
    return fileExec.getAbsolutePath();
  }
  throw new IllegalStateException(programName + " executable not found. " + (envs.size() > 0 ?
                                                                             "Please define a valid environment variable " +
                                                                             envs.iterator().next() +
                                                                             " pointing to the " +
                                                                             programName +
                                                                             " executable." : ""));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:Executor.java

示例2: suggestSdkDirectoryPathFromEnv

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
private static String suggestSdkDirectoryPathFromEnv() {
    File fileFromPath = PathEnvironmentVariableUtil.findInPath(SquirrelConstants.SQUIRREL_COMPILER_NAME);
    if (fileFromPath != null) {
        File canonicalFile;
        try {
            canonicalFile = fileFromPath.getCanonicalFile();
            String path = canonicalFile.getPath();
            if (path.endsWith("bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME)) {
                return StringUtil.trimEnd(path, "bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME);
            }
        } catch (IOException ignore) {
        }
    }
    return null;
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:17,代码来源:SquirrelSdkUtil.java

示例3: getCondaExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
public static String getCondaExecutable() {
  final String condaName = SystemInfo.isWindows ? "conda.exe" : "conda";
  final File condaInPath = PathEnvironmentVariableUtil.findInPath(condaName);
  if (condaInPath != null) return condaInPath.getPath();
  return getCondaExecutable(condaName);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PyCondaPackageService.java

示例4: findExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nonnull
public static String findExecutable(@Nonnull String programName, @Nonnull String unixExec, @Nonnull String winExec, @Nonnull Collection<String> envs) {
  String exec = findEnvValue(programName, envs);
  if (exec != null) {
    return exec;
  }
  File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
  if (fileExec != null) {
    return fileExec.getAbsolutePath();
  }
  throw new IllegalStateException(programName +
                                  " executable not found. " +
                                  (envs.size() > 0 ? "Please define a valid environment variable " + envs.iterator().next() + " pointing to the " + programName + " executable." : ""));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ExecutableHelper.java

示例5: get

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@NotNull
public static SceneBuilderInfo get(Project project, boolean choosePathIfEmpty) {
  JavaFxSettings settings = JavaFxSettings.getInstance();
  String pathToSceneBuilder = settings.getPathToSceneBuilder();

  if (StringUtil.isEmptyOrSpaces(pathToSceneBuilder) || !new File(pathToSceneBuilder).exists()) {
    VirtualFile sceneBuilderFile = null;
    if (choosePathIfEmpty) {
      sceneBuilderFile = FileChooser.chooseFile(JavaFxSettingsConfigurable.createSceneBuilderDescriptor(), project, getPredefinedPath());
    }
    if (sceneBuilderFile == null) {
      return EMPTY;
    }

    pathToSceneBuilder = FileUtil.toSystemIndependentName(sceneBuilderFile.getPath());
    settings.setPathToSceneBuilder(pathToSceneBuilder);
  }

  File sceneBuilderLibsFile;

  if (SystemInfo.isMac) {
    sceneBuilderLibsFile = new File(new File(pathToSceneBuilder, "Contents"), "Java");
  }
  else if (SystemInfo.isWindows) {
    File sceneBuilderRoot = new File(pathToSceneBuilder);
    File sceneBuilderRootDir = sceneBuilderRoot.getParentFile();
    if (sceneBuilderRootDir == null) {
      final File foundInPath = PathEnvironmentVariableUtil.findInPath(pathToSceneBuilder);
      if (foundInPath != null) {
        sceneBuilderRootDir = foundInPath.getParentFile();
      }
    }
    sceneBuilderRoot = sceneBuilderRootDir != null ? sceneBuilderRootDir.getParentFile() : null;
    if (sceneBuilderRoot != null) {
      final File appFile = new File(sceneBuilderRootDir, "app");
      if (appFile.isDirectory()) {
        sceneBuilderLibsFile = appFile;
      }
      else {
        final File libFile = new File(sceneBuilderRoot, "lib");
        sceneBuilderLibsFile = libFile.isDirectory() ? libFile : null;
      }
    }
    else {
      sceneBuilderLibsFile = null;
    }
  }
  else {
    sceneBuilderLibsFile = new File(new File(pathToSceneBuilder).getParent(), "app");
  }

  if (sceneBuilderLibsFile != null && (!sceneBuilderLibsFile.exists() || !sceneBuilderLibsFile.isDirectory())) {
    sceneBuilderLibsFile = null;
  }

  return new SceneBuilderInfo(pathToSceneBuilder, sceneBuilderLibsFile == null ? null : sceneBuilderLibsFile.getAbsolutePath());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:58,代码来源:SceneBuilderInfo.java

示例6: getMakeExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
@Nullable
public static String getMakeExecutable() {
    File make = PathEnvironmentVariableUtil.findInPath("make");
    if (make == null) return null;
    return make.getAbsolutePath();
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:7,代码来源:SquirrelSdkUtil.java

示例7: findInPath

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入方法依赖的package包/类
public File findInPath(String fileName) {
  return PathEnvironmentVariableUtil.findInPath(fileName);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:4,代码来源:SystemEnvironmentProvider.java


注:本文中的com.intellij.execution.configurations.PathEnvironmentVariableUtil.findInPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。