I plan to execute the jar command using a jar that is included in another jar.
The command automatically obfuscates the Java jar file using code similar to:
public void obfuscate()
{
try
{
String jre = "\"" + System.getProperty("java.home") + "\\bin\\javaw.exe" + "\"";
String jar = " -jar";
Runtime.getRuntime().exec(new String[] { jre, jar.trim(), "/lib/allatori.jar /lib/config.xml" });
}
catch (Exception e)
{
e.printStackTrace();
}
}
allatori.jarthe file is included in my file main.jaras a resource. A file is config.xmlalso included.
How can I run my command so that it executes the included jar file?
The structure of the main.jar folder :
- main.jar
|
|- main_class.class
|- lib/
|- allatori.jar
|- config.xml
|- jarToObfuscate.jar
source
share