How to run command line Linux via Java in RapidMiner Studio?
Dear Rapidminer,
I use RapidMiner Studio.
I want to create my own process and execute it via Java, then execute command line in Linux
Process process = Runtime.getRuntime().exec(new String[] { "sh", "-c", command });
My environment:
RAPIDMINER_HOME = /../myHome/rapidminer-studio
JAVA_HOME = /../myHome/Project/jdk1.8.0_144/bin
gradle.properties file with contain : version=1.0.0
I use Rapidminer 7.7-NAPSHOT -> it's working
but I use Rapidminer 7.6 (NON NAPSHOT), I have get error message :
Exception: java.security.AccessControlException
Message: access denied ("java.io.FilePermission" "<<ALL FILES>>" "execute")
Stack trace:
java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
java.security.AccessController.checkPermission(AccessController.java:884)
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
com.rapidminer.security.PluginSecurityManager.checkPermission(PluginSecurityManager.java:42)
java.lang.SecurityManager.checkExec(SecurityManager.java:799)
java.lang.ProcessBuilder.start(ProcessBuilder.java:1018)
java.lang.Runtime.exec(Runtime.java:620)
java.lang.Runtime.exec(Runtime.java:528)
.
.
.
----------------------------------------
I try to :
+ Set RAPIDMINER_HOME = /../myHome/rapidminer-studio -> fail
or RAPIDMINER_HOME = /../myHome/rapidminer-studio/lib -> fail
+ Java
JAVA_HOME = /../myHome/Project/jdk1.8.0_144/bin -> fail
or JAVA_HOME = /../myHome/Project/jdk1.8.0_144/jre/bin -> fail
=> I fail both of my way
+ Set value in gradle.properties file
version=1.0.0-SNAPSHOT -> fail
or version=1.0.0 -> fail
+ Rapidminer
I found the link with Question 5 "I want to create my own process and execute it via Java. What is the best way to do this?"
http://community.rapidminer.com/t5/Developer-Forum/Frequently-Asked-Questions-Development/td-p/19782
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init(); --> Get error message
RepositoryLocation pLoc = new RepositoryLocation("//Local Repository/folder/as/needed/yourProcessName"); -> How to find 'yourProcessName' ?
ProcessEntry pEntry = (ProcessEntry) pLoc.locateEntry();
String processXML = pEntry.retrieveXML();
Exception: java.security.AccessControlException
Message: access denied ("java.util.PropertyPermission" "https.proxyHost" "write")
Please help me, I want to run my command in Linux via Java.
Process process = Runtime.getRuntime().exec(new String[] { "sh", "-c", command });