jdc987
jdc987

Reputation: 743

How would I compile this java project directory that was made in Eclipse in mac terminal?

I have this directory:

JavaProject (root folder)
    /audio
    /bin
        /keys
        /ScreenManagement
    /images
    /src
        /keys
        /ScreenManagement

The bin folder has all the class files. The src folder has all the java files.

The main file that needs to be run is Game which is a java file in the src, and a class file in the bin. I am currently running it by using this command in the terminal:

/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java -Dfile.encoding=US-ASCII -classpath "/Users/chris/Documents/School/-Senior/CSC 225 A/JavaProject/bin" Game

What command would I need to use to compile the files into the proper directories when I make a change to a java file?

Upvotes: 1

Views: 168

Answers (1)

Travis
Travis

Reputation: 2767

You would use javac -d /Users/chris/Documents/School/-Senior/CSC 225 A/JavaProject/bin sourcefile_you_want_to_compile inside the src directory.

Or are you asking for the source to be compiled automatically after changes are made?

Upvotes: 2

Related Questions