How to set destination of the class file in Java



Problem Description

How to set destination of the class file?

Solution

Following example demonstrates how to set destination of the class file that will be created after compiling a java file using -d option with javac command.

c:> javac demo.java -d c:\myclasses 

Result

The above code sample will produce the following result.

Demo application executed.
java_environment_setup.htm
Advertisements