Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] how to pass parameter values from command line [Java]

Ok, I've found the following topics/bugs that show how to do it in Perl, but how can I do it in Java?
316
634
1414
This topic shows how to add the values to the code in the .sh or .bat files, but I want to add it to the command line call for that .sh or .bat file
1616
Do I just call the file in the command window and put "--context_param parameter1=adsfakf" in the command line after the name of the .bat file?
Ex. C:\>BatchFile.bat "--context_param parameter1=adsfakf"

Also, when passing a parameter at the command line, do I need to check the Prompt checkbox for that parameter in the Contexts tab/view?
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Java generated script was designed based on Perl generated script, as far as command line option are concerned. Conclusion : do it the same way. But don't do it in the *.bat call, but on the "java" call (look inside the *.bat file).
Thanks to fnoury request in 4258, you should soon be able to give --context_param key="value" to the *.bat file.

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Anyone know how to do this in Java???
Anonymous
Not applicable
Author

Not sure, but I did some exploring on the net - perhaps this will provide a needed clue:
http://www.javaworld.com/javaworld/javaqa/1999-07/02-qa-shell.html
Anonymous
Not applicable
Author

Java generated script was designed based on Perl generated script, as far as command line option are concerned. Conclusion : do it the same way. But don't do it in the *.bat call, but on the "java" call (look inside the *.bat file).
Thanks to fnoury request in 4258, you should soon be able to give --context_param key="value" to the *.bat file.
Anonymous
Not applicable
Author

1615
_AnonymousUser
Specialist III
Specialist III

I just posted a short tutorial on my blog about this.
How to pass parameter values from command line
Hope this help
Roberto
_AnonymousUser
Specialist III
Specialist III

Anonymous
Not applicable
Author

Sorry, the url for the tutorial is
http://www.robertomarchetto.com/www/how_to_parameter_values_talend_job_command_line

Very nice blog post. Thanks a lot!
Best,
Pcoffre.