Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The VeryTime,Stay informed and read the latest news today from The VeryTime, the definitive source.

How to Make Dependencies in Java

11
    • 1). Click "Start" and type "cmd" into the search box, then press "Enter." A new Command window will open.

    • 2). Change the Command window's current folder to the folder containing your Java source code files by typing the following command:

      cd "\Users\krista\javaDevelopment\proj2"

      Replace "\Users\krista\javaDevelopment\proj2" with the full path to the folder containing your Java sources. Press "Enter."

    • 3). Launch the text editor of your choice to create a new file named "Makefile".

    • 4). Type "make" dependency specifications into the text editor, as in the following example:

      default: mainClass

      mainClass: mainClass.java accessoryClass.java

      javac mainClass.java

      The line that defines "default:" to correspond to a label of your choice is required; that label must be defined elsewhere in the file. Each dependency specification has a first line listing the files that, when changed, trigger the dependency--and a second line specifying which command should be run when the dependency has been triggered. In this example, the main class gets recompiled whenever its own source code or the source code of an accessory class has changed.

    • 5). Save the file and exit the editor when you have entered all the required dependencies for your Java project.

    • 6). Compile all Java classes that happen to need to be recompiled by typing the following command:

      make

      Press "Enter."

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.