0

Currently I have created a basic java application in Eclipse and when I run it the IO occurs in the Eclipse integrated console window which is not quite convenient. I'd like to debug an eclipse application in a separate system console window (cmd.exe) which opens once I run the program and closes if I stop debugging or the program exits.

So what is the easiest way to achieve such a behavior?

I tried using a simple batch file (following this)

cmd.exe /c <Path to javaw> %*

then I saved this batch to the desktop and set the jre executable to this file (using full path) in Run Configurations->Alternate JRE->Java executable->Alternate. Yet when I run the program it says that specified executable does not exist for jre6. Do I have to put the batch file in the folder with jre6 binary files (java, javaw etc). The path is in the program files directory while I'm on a limited account.

Is there any other way?

Seems that I have found some kind of a solution. Not the best probably. So the batch now is

start /wait cmd.exe /c ""C:\Program Files\Java\jre6\bin\java" %*"

and in Eclipse settings I had to write a path relative to the JRE6/bin as follows:

../../../../Users/Name/Desktop/java.bat
Community
  • 1
  • 1
Alex G
  • 307
  • 3
  • 7
  • Curious, why do you want the console output to show up inside of cmd.exe instead of in the eclipse console? The easiest way would be to simply not run the program from within Eclipse and just run it from the command prompt. – Eric Rosenberg Apr 23 '14 at 20:29
  • You can start the java to be debugged remotely. I must admit that I don't recall the syntax by heart, but I can post it in some hours (when back at work PC), if you need it. Just comment back to me if you want it. – jedison Apr 23 '14 at 20:42

0 Answers0