environment

Java Runtime command line Process

痴心易碎 提交于 2020-01-14 14:55:09
问题 I have a class with the following code: Process process = null; try { process = Runtime.getRuntime().exec("gs -version"); System.out.println(process.toString()); } catch (Exception e1) { e1.printStackTrace(); } finally { process.destroy(); } I can run "gs -version" on my command line and get: GPL Ghostscript 8.71 (2010-02-10) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. So I know I have the path at least set somewhere. I can run that class from command line and it works. But

Java Runtime command line Process

那年仲夏 提交于 2020-01-14 14:55:08
问题 I have a class with the following code: Process process = null; try { process = Runtime.getRuntime().exec("gs -version"); System.out.println(process.toString()); } catch (Exception e1) { e1.printStackTrace(); } finally { process.destroy(); } I can run "gs -version" on my command line and get: GPL Ghostscript 8.71 (2010-02-10) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. So I know I have the path at least set somewhere. I can run that class from command line and it works. But

Setting environment variables in eclipse that references other environment variables

假如想象 提交于 2020-01-14 05:15:14
问题 I have Eclipse Helios with a java program set up. I'm attempting to create two environment variables ReportingManagerHome=C:\rp ReportingManagerConfig=${ReportingManagerHome}\config I then run my program with System.out.println(System.getenv("ReportingManagerConfig")); Eclipse doesn't even call the java compiler. It throws up a pop up window with the error that environment variable ReportingManagerHome is not defined. I understand that since the java compiler has yet to be called, technically

R - evaluate nested function call in a deserialized environment

守給你的承諾、 提交于 2020-01-14 02:53:10
问题 I am trying to run an already existing chunk of R code in a sandbox-ed fashion, by saving the global environment (containing functions and data) to a file, then loading it into a new environment (not the global environment) and evaluating a function call within that environment. However, I'm running into trouble with functions calling other functions in the environment. Here's an example: f1 <- function(x) x*2 f2 <- function(y) f1(y) + 1 save(list=ls(), file="env.RData") rm(list=ls()) jobenv

Setting environment variable TESSDATA_PREFIX in Tomcat

扶醉桌前 提交于 2020-01-12 10:42:32
问题 We are using Tesseract OCR Java library called Tess4J. It works fine if run as a standalone application. It needs a variable called TESSDATA_PREFIX which contains the tessdata config and other charset related files. It also runs fine with embedded Tomcat 6 server in eclipse. I had set TESSDATA_PREFIX as an environment variable by using the launch configuration. But when I package everything into a WAR and drop it in deploy directory of tomcat, the environment variable does not seem to be

Setting environment variable TESSDATA_PREFIX in Tomcat

岁酱吖の 提交于 2020-01-12 10:40:17
问题 We are using Tesseract OCR Java library called Tess4J. It works fine if run as a standalone application. It needs a variable called TESSDATA_PREFIX which contains the tessdata config and other charset related files. It also runs fine with embedded Tomcat 6 server in eclipse. I had set TESSDATA_PREFIX as an environment variable by using the launch configuration. But when I package everything into a WAR and drop it in deploy directory of tomcat, the environment variable does not seem to be

How do I launch a java process that has the standard bash shell environment?

*爱你&永不变心* 提交于 2020-01-11 07:20:09
问题 I've tried looking into process builder, but I'm not sure how to source the bash environment into the process. For example I'm using the following to launch my process: Process p = new ProcessBuilder(args).start(); InputStream is = p.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); And I'd like my standard shell environment (from /etc/profile, .bashrc, etc.) sourced to the process. Sorry if I'm not using the right terms - still

How to get virtualenv to use dist-packages on Ubuntu?

丶灬走出姿态 提交于 2020-01-09 13:56:29
问题 I know that virtualenv, if not passed the --no-site-packages argument when creating a new virtual environment, will link the packages in /usr/local/lib/python2.7/site-packages (for Python 2.7) with a newly-created virtual environment. On Ubuntu 12.04 LTS, I have three locations where Python 2.7 packages can be installed (using the default, Ubuntu-supplied Python 2.7 installation): /usr/lib/python2.7/dist-packages : this has my global installation of ipython, scipy, numpy, matplotlib –

How to read properties file from Jenkins 2.0 pipeline script

◇◆丶佛笑我妖孽 提交于 2020-01-09 11:02:46
问题 I am attempting to write a pipeline script to use with Jenkins 2.0 to replicate our existing build. This original build used the envInject plugin to read a Java properties file, but I can't see how to do this from the pipeline Groovy script. I have Googled and found the following, but it doesn't work (FileNotFoundException): Properties props = new Properties() File propsFile = new File('./Builder/project.properties') props.load(propsFile.newDataInputStream()) Thanks! 回答1: I just fought with

How to include all lib folder?

旧街凉风 提交于 2020-01-06 15:43:24
问题 I want to extend core Array class with simple method: class Array def to_hash result = Hash.new self.each { |a| result[a] = '' } result end end I put array.rb into lib/core_ext and tried to require it in application.rb by config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += Dir["#{config.root}/lib/**/"] But still get undefined method 'to_hash' for ["var1", "var2", "var3"]:Array if tried to use it in model method. Of course I rebooted the server after code changes. 回答1: