To download eclipse First, I chose the Eclipse IDE for Java Developers64 bit version, download it and unzip it to your favorite location and double-click Eclipse.exe to start
Then start the new project, File-and new Java project, with the project name casually written, as
Right-click the src folder, Add-New Java class, here you need to note that the Name column is the class name, I wrote TESTALGS4, in order to test the "algorithm fourth version" of the test given by the author of the sample
The code is as follows:
Import Edu.princeton.cs.algs4.StdDraw;Public Class TestAlgs4 {Public Static void Main(String[]Args){Stddraw.Setscale(-1,1);Stddraw.Clear(Stddraw.BLACK);Stddraw.Setpencolor(Stddraw.White);Stddraw.Square(0,0,1);Write some text Stddraw.Setpencolor(Stddraw.White);Stddraw.Text(0,+0.95,"Hello, world! This is a test for Java program. ");Stddraw.Text(0,-0.95,"Close This window to finish the installation.");Draw the Bullseye Stddraw.Setpencolor(Stddraw.Book_blue);Stddraw.Filledcircle(0,0,0.9);Stddraw.Setpencolor(Stddraw.BLACK);Stddraw.Filledcircle(0,0,0.8);Stddraw.Setpencolor(Stddraw.Book_blue);Stddraw.Filledcircle(0,0,0.7);Stddraw.Setpencolor(Stddraw.BLACK);Stddraw.Filledcircle(0,00.6 ); //draw a picture of the textbook Stddraw. (000.65 0.80 ); } /span>
Calling the ALGS4 library in eclipse