Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » How execute a java program ?
How execute a java program ? [message #1729954] Wed, 20 April 2016 13:28 Go to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 22
Registered: September 2014
Junior Member
Hi,

I want to execute a java routine to resolve environment variables.
I do a jar and for information my jar works on a command prompt.

but under RCPTT I've an error : Execution failed, exit code: 1. at exec-process

My command :
exec-process -command "\"C:\\Program Files (x86)\\Java\\jre1.8.0_66\\bin\\java.exe\"" -args "-jar" -args "\"C:\\Users\\moi\\rcpttWorkspace\\Tests\\utils\\Utils.jar\"" -args "\"arg0\"" | invoke getStdout | log

Do you see anything wrong ? Confused
Thank you
Re: How execute a java program ? [message #1730053 is a reply to message #1729954] Thu, 21 April 2016 07:51 Go to previous messageGo to next message
Andrey Sobolev is currently offline Andrey SobolevFriend
Messages: 75
Registered: February 2015
Member
Hi,

I've added a fix to display stderr by default if exit code is not 0.
For now you could try use -ignoreExitCode to allow proper stderr message to appear in test execution.

exec-process -ignoreExitCode -command "/usr/bin/java" -args "-jar" -args "my_test.jar " -args "arg0"| get stderr | log


Best regards,
Andrey.
Re: How execute a java program ? [message #1730102 is a reply to message #1730053] Thu, 21 April 2016 11:29 Go to previous messageGo to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 22
Registered: September 2014
Junior Member
thank you, I've a result !
but I don't understand the error :

Execution failed, stderr:
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
.
at exec-process (/SystemWorkbenchTests/VerifEnvironmentVariables.ctx:45)

[Updated on: Thu, 21 April 2016 11:42]

Report message to a moderator

Re: How execute a java program ? [message #1735709 is a reply to message #1730102] Wed, 22 June 2016 08:06 Go to previous message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

Take a look to https://www.eclipse.org/forums/index.php/m/1711069/#msg_1711069

"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova
Previous Topic:Runner.cmd
Next Topic:Concat a list of strings
Goto Forum:
  


Current Time: Mon Sep 23 10:33:40 GMT 2024

Powered by FUDForum. Page generated in 0.03853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top