Working Compler!!

Newbie Spellweaver
Joined
Aug 31, 2008
Messages
38
Reaction score
0
Here is the working compiler that I use!

@echo off
if exist "%programfiles%\Java" (call :compile "%programfiles%\Java\") else (goto error)
:compile
for /D %%x in ("%~1jdk*") do (set p="%%~x\bin\javac.exe")
if defined p (%p% -cp . *.java)
if defined p (goto end)
:error
echo You do not have Java installed. Please download it at the site that is about to load.
"%programfiles%\Internet Explorer\iexplore.exe"
:end
echo Finished!
pause
exit
 
Compiler don't work! LOLZ!

EDIT:
Sorry, I only forgot that I needed to re-download Java JDK but I am re-downloading now. I will tell you if it works.
 
Last edited:
Lawl Failed Tbh , Doesn't Work , You have Posted it Wrong Here is my Compiler it works Fine : For Example -
@echo off
title Pkz-Ftw!
cd ./src
echo Compiling
"C:\Program Files\Java\jdk1.6.0_14\bin\javac.exe" -cp . -d ../build/ ./server/pkz/ftw/Engine.java
pause

If that Dont Work Den idk , Make sure you change ur JDK Version to what it is.
 
Lawl Failed Tbh , Doesn't Work , You have Posted it Wrong Here is my Compiler it works Fine : For Example -
@echo off
title Pkz-Ftw!
cd ./src
echo Compiling
"C:\Program Files\Java\jdk1.6.0_14\bin\javac.exe" -cp . -d ../build/ ./server/pkz/ftw/Engine.java
pause

If that Dont Work Den idk , Make sure you change ur JDK Version to what it is.

javac doesnt exist in C:\Program Files\Java\jdk1.6.0_17\bin :/ any help please? i just dled latest JDK too

edit: im an idiot. sorry :p
 
*sigh* allow me to teach you guys how to correctly make a compiler, it's one of the easiest things you can do...

Please note: This is for WINDOWS USERS


Ok, so.. you have your batch file. If you right-click it, you should see an option called "edit"
Click on it, it should bring up a notepad file containing what that is. Now, IF YOU HAVE JAVA INSTALLED, find the directory
(Normal java users should have it in C:/Java/
The folder that has the highest number is the one you want.

Ex: jdk1.6_06 is lower than jdk1.6_07

Once you get there, you should see a folder named "bin" go there.
If it has an application named "javac" then you are in the right place.
Here's how you should format that notepad document you opened earlier:

Code:
@echo off
title Compiler
echo Compiling...
[delete this]YOUR ENTIRE DIRECTORY GOES HERE! EXAMPLE: 
"C:\Java\jdk1.6_16\javac.exe" *.java
[delete this]DO NOT FORGET THE QUOTATION MARKS AND THE JAVAC.EXE AT THE END!!!!!
echo DONE!
pause

Congratulations, make sure that your compiler is in the same folder as your java files and you're good.

----------------------------------------------------------------------------------------------------------------------------------------------------
FOR SUN JAVA USERS:

Your file may be somewhere like "C:/Sun/SDK/jdk/bin/javac.exe"
(I probably just did a manual install and that's why mine's there, either way, wherever your javac.exe executable file is is where the directory points to)

You're welcome.
 
Last edited:
Back