|
-
September 21st, 2000, 03:02 AM
#1
find javac in bat file
I want to create bat file that finding javac (only one ,in my computer there is
some jdk)then compile myProg.java with the founded javac.
then run the file myProg.class.
-
September 21st, 2000, 03:39 AM
#2
Re: find javac in bat file
Hi there
Ok here is how you can do it.
In this example your java file is on Windows
desktop.
Step 1:
Open a new file in notepad.
Step 2:
Type the following line in notepad>
cd\windows\desktop
Step 3:
On the next line type the following>
javac yourFile.java
Step 4:
On the next line type the following>
java yourFile
Step 5:
Save this file as "Whatever.bat" on windows
desktop, make sure you put the quotation marks around it as somtimes it will save
the file as Whatever.bat.txt and you will be wondering why it wont work.
Then you simply just double click on the batch file.
You can also create a shortcut to this batch file.
Good Luck Phill
-
September 21st, 2000, 04:31 AM
#3
Re: find javac in bat file
Hi,
Thanks.
I know how to create simple bat file and how to compile java code.
My question is how to build th bat that searching in the computre
javac and when finding some javac ,choose one
and compile .
I dont know where the jdk in the computre of the man that compile.
-
September 21st, 2000, 04:38 AM
#4
Re: find javac in bat file
Hi there
If the man with the computer has
his "Path" set correctly,
then the batch file that i posted is all
that you need.
It changes the working directory to where the class file is,
and dos will find javac.exe and java.exe if he has set his path correctly.
Phill.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|