faulty build path?

Posted on 2004-10-27
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
    LVL 92

    Accepted Solution

    assert is a new feature in 1.4, to avoid the warning add the following compile option:

    -source 1.4
    LVL 12

    Expert Comment


    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: From Zero to Hero with Nodejs & MongoDB

    Interested in Node.js, but don't know where to start or how to learn it properly? Confused about how the MEAN stack pieces of MongoDB, Expressjs, Angularjs, and Nodejs fit together? Or how it's even possible to run JavaScript outside of the browser?

    Suggested Solutions

    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

    913 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now