rawr jruby creating exe - rake

I've a very simple Ruby script, which I've used rawr to package up into a *.jar file. I can then run the *.jar file with java -jar *.jar. I would like to make my program into an executable so I did rake rawr:bundle:exe. It says that it successfully created an executable and I can see the executable it created.
What I don't understand is, when I double click the executable (or attempt to run it in the command prompt), it doesn't really do anything; it is supposed to display 'hello' and wait for me to push enter (on STDOUT) but nothing really happens. If I run the *.jar file, it displays 'hello'. How am I supposed to run the executable? I was expecting that when I double click the *.exe, that a command prompt window pop up displaying 'hello' and waiting for me to push enter...

Since the program displays to STDOUT, and doesn't have a GUI component, I think you need to run this from the command prompt. Not sure what OS your on, since you said .exe, I'm assuming windows. so you just need to run it from the command prompt instead of by double-clicking on it.
so in the same folder where you are able to succesfully execute:
java -jar *.jar
just type:
myApplication.exe
Or, if your in another location on the machine you can type:
C:\full\path\to\myApplication.exe
Otherwise, the process is just going to run in the background with no way for you to see the results.

Related

Can't get eclipse to run terminal command on mac

I have installed swig on my mac and it works in the console just fine. If I type swig -verison in terminal it spits out the version. Eclipse keeps telling me that it can't find swig. I am using the liquidfun library http://google.github.io/liquidfun/SWIG/html/index.html and it told me to put this export SWIG_BIN=$("which" swig) in .bashrc, which I did. This enviroment variable registers through terminal as well. Eclipse STILL won't grab swig properly. What the hell?
Bash reads .bash_profile, .bash_login or .profile. I don't expect the Eclipse process to load such a file (although I could be wrong) nor the SWIG_BIN variable to augment its search path for executables, but if you launch Eclipse from the shell, it should inherit the shell's environment variables.
Try running swig from eclipse using a full absolute path (the one that "which" returns).
The eclipse.ini file can set some startup parameters but perhaps not the path. There might be other eclipse startup files.
Another possibility is to add swig's directory to the path in a login script. (To test that, log out and back in, then start eclipse.)

how to execute c program in windows command prompt when run from eclipse cdt

I downloaded and configured eclipse cdt along with MinGW and able to compile c programs.
My question, how to start executing the program in command prompt when Run option clicked from eclipse. Currently it always executes the program in eclipse console.
Reason to have command prompt for executing c programs is to accept user inputs.
I would also like to know is there a way to accept user inputs when c program running in eclipse console.
Thanks in advance,
-Manju
I guess i am quite late but still you can try this out. You can execute c programs through Eclipse cdt by writing a batch file and calling them through a click of button or any other event handler. Just make sure you are in the correct directory before attempting to compile and execute the file.
You can find various resources online to create a batch file which can help you execute programs through the console.
On compiling the file, (if you haven't specified an output file), a.exe file will be created. To execute this file with command line inputs just type the following in cmd (as long as you are in the same directory)
a.exe "command line inputs"
where "command line inputs" are the inputs you want to provide to your program.
Hope this is helpful!
i know 8 years is very late,but maybe somone else like me see this,so my answer is :
you should use:
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
after every printf statment to be able to input data in eclipse ide console tab ,
as i understood :""The root cause of the I/O problem is that we're using Windows pipes to communicate with the underlying process. The pipes are buffered"
you can refer to this links for more informations;
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732

Batch file in eclipse path variables not found

I want to start a batch-script in my eclipse. (Instructions here: How to run a batch script (.bat file) from eclipse)
In my batch file i need some commands like pear or phing.
I put the path to these commands into my environment variable called PATH.
(Works fine with cmd manually)
After starting the script, I'm getting this error:
'pear' is not recognized as an internal or external command,
operable program or batch file.
If I type pear by hand, it doesn't work either.
You need to restart Eclipse after changing the system environment; environment variable changes requires any process that is already running to be restarted in order for that application to pick up the changes.
Another option might be to put the full path to those commands in the .bat file so that it doesn't rely on the system environment in order to work properly.
Tip: Make sure to close and start eclipse afresh for PATH variable changes to take effect. Using the Restart option in File menu may not help here.

Showing errors when program run from batch file crashes

I have a batch file (.bat) in Windows which I am using to run a program. The problem is sometimes the program crashes and I'd like to know when it does. If I double-click the program's .exe in an Explorer window and the program crashes (like if a .dll is missing) then I get a message like
The program can't start because XXXX.dll is missing from your computer. Try reinstalling the program to fix this problem.
But when I run the program through the .bat file, I don't get any indication that the program crashes - no popup, no output to the command line.
I'm guessing it has something to do with the .bat file absorbing the error message. For reference my .bat file looks like this (shortened to keep the post simple):
start directory\program.exe
I'd like to get an indication that the program has crashed. Is there something I can add to my .bat file to see that?
Using the start command creates a new command line window for program.exe to run in. That window closes immediately when program.exe exits, thereby hiding the error from you.
To fix it, simply change "start directory\program.exe" to "directory\program.exe"

Eclipse: Add Command-Line Args to an OS X .app Directory

Is it possible to add custom command-line arguments to an Eclipse .app folder? In my particular case, I'm working with ZendStudio. I'm assuming the base Eclipse release would behave the same way.
I've found what looks like two different places that could work, but neither yield any results:
ZendStudio.app\Contents\info.plist
ZendStudio.app\Contents\MacOS\ZendStudio.ini
Am I looking in the right place, or is this even possible?
If you mean that you want to start Eclipse with some command line arguments, there is no file where you can add those to be used as default. But you can make a small script that will start Eclipse with the arguments you want, something like:
/Applications/Eclipse.app/Context/MacOS/eclipse some command line arguments
and then add executable permissions to your script, through Terminal window:
chmod 755 your_file
you can just type "chmod 755 " on the terminal and then drag and drop the script file on the terminal window, it will type the file's full path onto it, press ENTER and that's it. You can double-click your script file and it will start up Eclipse with the command line arguments you typed.