Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Paul LeDuc](https://secure.gravatar.com/avatar/2edaeae5b9f7db2217e2a83034d80627?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Paul LeDuc
7,844 Points[SOLVED] Java printf not seeming to work for me?
I have the following code:
package p;
import java.io.*;
public class Test {
// -----------------------------------------------------------------------
// Constants.
// -----------------------------------------------------------------------
public final static String TAG = Test.class.getSimpleName();
// -----------------------------------------------------------------------
// Members.
// -----------------------------------------------------------------------
private long mDuration = 0;
// -----------------------------------------------------------------------
// Constructors.
// -----------------------------------------------------------------------
public Test(long milliseconds) {
mDuration = milliseconds;
}
// -----------------------------------------------------------------------
// Methods.
// -----------------------------------------------------------------------
public void start() {
System.out.printf("%-6d: \n", mDuration);
}
}
The message I am receiving is that the method printf(String, Object[] in the type PrintStream is not applicable for arguments (String, long)
What am I missing?
![Ken Alger](https://secure.gravatar.com/avatar/cf2cad7e6e37acacfa5201068856ed3d?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ken Alger
Treehouse TeacherEdited for markup and [SOLVED].
Please see this post for directions on how to post to the forum.
Paul LeDuc
7,844 PointsPaul LeDuc
7,844 PointsApparently, this was a result of a project setting in Eclipse. It had to do with the Java Compiler compliance level.