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


Java JavaEnvUtils.getJdkExecutable方法代码示例

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


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

示例1: compile

import org.apache.tools.ant.util.JavaEnvUtils; //导入方法依赖的package包/类
/**
 * Performs the actual compilation.
 * @param javah the calling javah task.
 * @return true if the compilation was successful.
 * @throws BuildException if there is an error.
 */
@Override
public boolean compile(Javah javah) throws BuildException {
    Commandline cmd = SunJavah.setupJavahCommand(javah);
    Project project = javah.getProject();
    String executable = JavaEnvUtils.getJdkExecutable("javah");
    javah.log("Running " + executable, Project.MSG_VERBOSE);
    cmd.setExecutable(executable);

    //set up the args
    String[] args = cmd.getCommandline();

    try {
        Execute exe = new Execute(new LogStreamHandler(javah,
                Project.MSG_INFO,
                Project.MSG_WARN));
        exe.setAntRun(project);
        exe.setWorkingDirectory(project.getBaseDir());
        exe.setCommandline(args);
        exe.execute();
        return !exe.isFailure();
    } catch (IOException exception) {
        throw new BuildException("Error running " + executable
                + " -maybe it is not on the path", exception);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:32,代码来源:ForkingJavah.java

示例2: execute

import org.apache.tools.ant.util.JavaEnvUtils; //导入方法依赖的package包/类
/**
 * exec by creating a new command
 * @return true if the command ran successfully
 * @throws BuildException on error
 */
@Override
public boolean execute() throws BuildException {
    Rmic owner = getRmic();
    Commandline cmd = setupRmicCommand();
    Project project = owner.getProject();
    String executable = owner.getExecutable();
    if (executable == null) {
        // no explicitly specified executable
        // rely on RMIC being on the path
        executable = JavaEnvUtils.getJdkExecutable(getExecutableName());
    }
    cmd.setExecutable(executable);

    //set up the args
    String[] args = cmd.getCommandline();

    try {
        Execute exe = new Execute(new LogStreamHandler(owner,
                Project.MSG_INFO,
                Project.MSG_WARN));
        exe.setAntRun(project);
        exe.setWorkingDirectory(project.getBaseDir());
        exe.setCommandline(args);
        exe.execute();
        return !exe.isFailure();
    } catch (IOException exception) {
        throw new BuildException("Error running " + getExecutableName()
                + " -maybe it is not on the path", exception);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:36,代码来源:ForkingSunRmic.java

示例3: getSystemJavac

import org.apache.tools.ant.util.JavaEnvUtils; //导入方法依赖的package包/类
/**
 * @return the executable name of the java compiler
 */
protected String getSystemJavac() {
    return JavaEnvUtils.getJdkExecutable("javac");
}
 
开发者ID:apache,项目名称:ant,代码行数:7,代码来源:Javac.java


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