Make your own free website on Tripod.com

Setting Up Visual Studio 6.0 For Java

Written By: Joshua Greenstein

First open Microsoft Visual C++ 6.0.

Under the Tools menu, click on Customize.

Click on the Tools Tab.

Click the New icon (the first of four on the top right).

Type JavaC and press Enter.

On the Command Line, set the path to javac.exe.
For example: C:\Program Files\Java\jdk1.5.0_04\bin\javac.exe

On the Arguments line, type $(FileName).java.

On the Initial Directory line, type $(FileDir).

Then place a Check on Use Output Window, and make sure the other 2 are not checked.

Click the New icon (the first of four on the top right).

Type Java and press Enter.

On the Command Line, set the path to java.exe.
For example: C:\Program Files\Java\jdk1.5.0_04\bin\java.exe

On the Arguments line, type $(FileName).

On the Initial Directory line, type $(FileDir).

Then place a Check on Use Output Window, and make sure the other 2 are not checked.

Then click on the Toolbars tab on top.

Click New and Type in Java.

Then click Close.

Go to the Tools menu and look for the 2 numbers associated with your 2 new tools. It is the number under the hammer next to JavaC and Java. Remember which number is which.

Then click Customize.

Under the Commands tab, go down in the Category list and select Tools.

Now click the hammer with the correct number and drag it to the little Java toolbar box you created a minute ago.

Click the next hammer and repeat the previous step and place it to the right of the first one.

Without closing the Customize box, right click the first icon on the toolbar, NOT the one in the Customize Window, and select Button Appearance...

You are free to customize it any way you like, but the best way is to select Image and Text.

Choose your favorite image in the box, and type JavaC as the Button Text. Click OK.

Right click the next icon and select Button Appearance... like before.

Select Image and Text and type Java as the Button Text. Click OK.

Now click Close on the Customize window, and drag the toolbar next to another toolbar, so it is not a floating box.

To use these new buttons:

Create a text file, saved with the extension .java.

Click JavaC to Compile the program.

On the bottom window, it should say : Tool returned code: 0. This means your program compiled successfully.

Then click the Java icon to Run the program.

On the bottom window, it should print the output of the program and then say: Tool returned code: 0. This means it ran successfully.

The End!

If you have any questions about this, please email the Class Mailing List at cis26mw1@sci.brooklyn.cuny.edu or Professor Gerald Weiss at weiss@sci.brooklyn.cuny.edu.