Java Compiler Help Needed! (I'm using batch)
Posted: 24 Jul 2010 10:33
Okay I'm using a batch file to compile and run my java programs. This is the code:
Where it says "if %classname%==BeerSong" which is a specific class I want this done for, I want the whole cmd to be placed into a text file. Is that possible?
Code: Select all
@echo off
title Mike Spallino's Java Compiler and Runner
:start
cls
echo.-----------
echo Options:
echo c - Compile
echo r - Run
echo.-----------
set /p input=Option:
if %input%==C goto compile
if %input%==c goto compile
if %input%==R goto run
if %input%==r goto run
:compile
cls
javac *java
pause
cls
goto start
:run
cls
set /p classname=Enter the class name:
pause
cls
java %classname%
pause
if %classname%==BeerSong
cls
set /p goback=Would you like to go back to the begining? (Y/N)
if %goback%==Y goto yes
if %goback%==y goto yes
if %goback%==N goto no
if %goback%==n goto no
pause
cls
echo That is not a valid command. You are now being disconnected.
pause >nul
exit
:yes
cls
pause
goto start
:no
cls
echo Thank you for using my compiler!
pause
exit
Where it says "if %classname%==BeerSong" which is a specific class I want this done for, I want the whole cmd to be placed into a text file. Is that possible?