Re: edsharp and running java class files

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: Blind Programming List <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 21 Sep 2009 10:24:32 -0400 (EDT)

Suppose your program is MyApp.java, compiled to MyApp.class, and located
in the C:\MyApp directory.  I assume the directory containing java.exe
is on the Windows search path.  The program may be run with the
following command at a DOS prompt:

java.exe -cp C:\MyApp MyApp

Suppose the file C:\MyApp\MyApp.java is the active document in EdSharp.
Press Alt+F5 for the Prompt Command, and input the following:

java.exe -cp %SourceDir% %SourceRoot%

If you then press Enter, the program should run.  The prompt command
will be remembered, so you just have to press Alt+F5 and Enter the next
time.

If the program is a console mode one without some kind of pause
statement at the bottom, however, the console window will close before
you can read any output that the program prints to the screen.  I do not
know Java well enough to suggest a command to put at the bottom of the
file so that the screen pauses (e.g., in Python a call to raw_input()
would do this).  One approach to address this would be to run the
program from a batch file that included the DOS pause command at the
end.  For Example, you could create the file C:\MyApp\RunMyApp.bat
containing the following lines:

@echo off
cls
java.exe -cp C:\MyApp MyApp
pause

Jamal

On Sun, 20 Sep 2009, Alex Hall wrote:

> Date: Sun, 20 Sep 2009 14:12:13 -0400
> From: Alex Hall <mehgcap@xxxxxxxxx>
> Reply-To: programmingblind@xxxxxxxxxxxxx
> To: Blind Programming List <programmingblind@xxxxxxxxxxxxx>
> Subject: edsharp and running java class files
>
> Hi all,
> EdSharp compiles my .java files to .class files just fine, but when I try to
> run them, I just get "returning". I am not sure why this is; is there a way
> to get java.exe to run with the classpath of my working directory and a
> filename argument of my file, without the .class, since java.exe seems to
> want these arguments?
>
>
> Have a great day,
> Alex
> New email address: mehgcap@xxxxxxxxx
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: