org.eclipse.jdt.internal.compiler.util.Util.getJavaHome()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.eclipse.jdt.internal.compiler.util.Util.getJavaHome()方法的一些代码示例,展示了Util.getJavaHome()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getJavaHome()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.util.Util
类名称:Util
方法名:getJavaHome

Util.getJavaHome介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public File getJavaHome() {
  if (!this.javaHomeChecked) {
    this.javaHomeChecked = true;
    this.javaHomeCache = Util.getJavaHome();
  }
  return this.javaHomeCache;
}

代码示例来源:origin: org.eclipse.scout.sdk/org.eclipse.scout.sdk.core

/**
 * @param jreHome
 *          The absolute path to the JRE (not JDK!) root. Based on this path the bootstrap classpath will be
 *          constructed. May be {@code null}. Then the running JRE is used.
 * @param paths
 *          The runtime classpath entries.
 */
protected ClasspathBuilder(final Path jreHome, final Collection<? extends ClasspathEntry> paths) {
 final Path javaHome = Optional.ofNullable(jreHome).orElseGet(() -> Validate.notNull(Util.getJavaHome(), "Cannot calculate the running Java home. Please specify a JRE home explicitly.").toPath());
 m_jreInfo = JRE_INFOS.computeIfAbsent(javaHome, JreInfo::new);
 final Map<ClasspathEntry, Classpath> classpath = toClasspath(paths);
 m_entries = classpath.keySet();
 m_classpath = classpath.values();
 m_bootClasspath = createBootClasspathFor(m_jreInfo);
 final List<Classpath> fullCp = new ArrayList<>(classpath.size() + m_bootClasspath.size());
 fullCp.addAll(classpath.values());
 fullCp.addAll(m_bootClasspath);
 m_full = fullCp.toArray(new Classpath[fullCp.size()]);
}

代码示例来源:origin: io.takari.maven.plugins/takari-lifecycle-plugin

private static List<Path> getJava8() throws IOException {
 // mostly copy&paste from tycho
 // See org.eclipse.jdt.internal.compiler.batch.Main.setPaths
 List<Path> classpath = new ArrayList<>();
 Path javaHome = Util.getJavaHome().toPath();
 // boot classpath
 scanForArchives(classpath, javaHome.resolve("lib"));
 // endorsed libraries
 scanForArchives(classpath, javaHome.resolve("lib/endorsed"));
 // extension libraries
 scanForArchives(classpath, javaHome.resolve("lib/ext"));
 return classpath;
}

代码示例来源:origin: takari/takari-lifecycle

private static List<Path> getJava8() throws IOException {
 // mostly copy&paste from tycho
 // See org.eclipse.jdt.internal.compiler.batch.Main.setPaths
 List<Path> classpath = new ArrayList<>();
 Path javaHome = Util.getJavaHome().toPath();
 // boot classpath
 scanForArchives(classpath, javaHome.resolve("lib"));
 // endorsed libraries
 scanForArchives(classpath, javaHome.resolve("lib/endorsed"));
 // extension libraries
 scanForArchives(classpath, javaHome.resolve("lib/ext"));
 return classpath;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.compiler.apt

public EclipseFileManager(Locale locale, Charset charset) {
  this.locale = locale == null ? Locale.getDefault() : locale;
  this.charset = charset == null ? Charset.defaultCharset() : charset;
  this.locationHandler = new ModuleLocationHandler();
  this.classloaders = new HashMap<>();
  this.archivesCache = new HashMap<>();
  this.isOnJvm9 = isRunningJvm9();
  try {
    initialize(Util.getJavaHome());
  } catch (IOException e) {
    e.printStackTrace();
    // ignore
  }
  try {
    this.bundle = ResourceBundleFactory.getBundle(this.locale);
  } catch(MissingResourceException e) {
    System.out.println("Missing resource : " + Main.bundleName.replace('.', '/') + ".properties for locale " + locale); //$NON-NLS-1$//$NON-NLS-2$
  }
}
protected void initialize(File javahome) throws IOException {

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

final File javaHome = getJavaHome();
if (javaHome != null) {
  File[] directoriesToCheck = null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

final File javaHome = getJavaHome();
if (javaHome != null) {
  File[] directoriesToCheck = null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

final File javaHome = getJavaHome();
if (javaHome != null) {
  File[] directoriesToCheck = null;

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

final File javaHome = getJavaHome();
if (javaHome != null) {
  File[] directoriesToCheck = null;

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

List<FileSystem.Classpath> filePaths = new ArrayList<>();
if (javaHome == null) {
  javaHome = getJavaHome();
  javaHome = getJavaHome();

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

final File javaHome = getJavaHome();
if (javaHome != null) {
  File[] directoriesToCheck = null;

相关文章