Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

RunCommand Error




I am having an issue with the RunCommand tool running Java (at least that is what I think it is).

Running the Sentiment Tool (from the Comparing Sentiment Analysis Algorithms article) I keep encountering this error: 

    "Error: Run Command (5): The external program "java" returned an error code: 2"


Thinking it was an issue with Java how is setup, I tried to run Java in a Command Window - that works. I was even able to run the StandfordCoreNLP Sentiment tool from a Command Window. I am also able to run Java from any directory, so I don't think it is a Path issue.


To test the RunCommand, I made a very simple workflow. Here's the Configuration for the RunCommand tool. This also is returning the same error as above.


I tried java, java.exe and  C:\Program Files\Java\jre1.8.0_181\bin\java.exe. None of those seemed to make a difference.


What is it that I am doing wrong?


Thank you for the help.

You will need to configure the run command closer to how it was in the original post. Look at this comment


You need to write out a CSV not a YXDB as Java will not be able to read Alteryx native format. 


The Java command is just the first part of the command. You need all the arguments to tell it to load the class and then perform the analysis.


Take a look at this bit of the Stanford site as well:

It talks over how to set up calling on the command line.


Given the prevalence of REST APIs for sentiment analysis you might find that an easier solution (e.g.





I appreciate the quick response. I do have the RunCommand configured like the original post (I didn't post that), but I was getting an error. So I tried to see if I could get just Java to run at all, with no arguments and no analysis.


I am able to run the analysis from a Command Line, but just not in Alteryx. 


Would you have an example of a simple test I can try to see if Java works using the RuCommand tool? 


Thank you!

Try the attached.




--version is the easiest argument to check Java works


Again, I really appreciate the help. Unfortunately that is not working for me. I am getting this error:


If I enter type: java -version into a Command Window, that works. I did also put an input.csv file in my %temp% directory, just in case that is an issue.

Sorry not to solve straight away but sure we can find a solition.


Try this one.


It wraps the Java command in a cmd shell. If it works it should stay open and display the Java version:



Type exit and the workflow should complete.


%temp% is a special Alteryx variable.


If this approach works then we can make Alteryx spit out a batch script file and then run that.



That worked!


However, when I opened the Workflow, I received a message saying:

This workflow was created by a more recent version of Alteryx, and may contain tools or functionality not present in this version. Alteryx  does not support using an earlier version of Alteryx to open a workflow created with a newer version. For best results, download the latest version of Alteryx .


I am on version 2018.2.5.48994.


So, what's the next step? (I wish I could insert a very excited emoji!)

Hi @gumbatman,


Sorry for delay in replying.


The next step is to amend the input macro to wrap in a cmd command. I'll stick a prototype together tonight and down version it to 2018.2.


Hopefully that will work for you.






No worries. I wouldn't have had a chance to check this over the weekend. Plus, you've been amazingly helpful already. Whenever you have a moment to put together a prototype, that would be great. 

Thank you so much.