Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


faulty build path?

Posted on 2004-10-27
Medium Priority
Last Modified: 2010-03-31
I downloaded some open source code, and am attempting to compile it. I've openned it in Eclipse, and positioned the files such that such that none of the import statements generate errors. Therefore, I have some of the build path correct. However, "assert" statements still generate warnings, and would cause the program not to compile. For example, this line: assert true : "test string";

I think "assert" only has meaning when junit is imported. Is this correct? The software source code came with junit-3.8.1.jar, so I included that file in the build path. Still those warnings are generated.

Why isn't "assert" being recognized as a command in my program? What is it about the way I'm importing libraries/setting up classpath/including libraries/...etc.?

Question by:bobwood2000
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 92

Accepted Solution

objects earned 1000 total points
ID: 12430433
assert is a new feature in 1.4, to avoid the warning add the following compile option:

-source 1.4

Author Comment

ID: 12434675
Problem solved! Here's how to make the changes to Eclipse:


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question