Shop OBEX P1 Docs P2 Docs Learn Events
Trying to write a class project in java but only half way thru intro to java !!! — Parallax Forums

Trying to write a class project in java but only half way thru intro to java !!!

paulhpaulh Posts: 2
edited 2008-04-10 22:58 in General Discussion
programs will not compilied

I am using the javelin board, modifing the DS1620 program for a student project.

I had no trouble in changing the parallax code Program listing 4.6 simple DS1620 BUT

When I try to change it as the Java teacher would want: Create a class that doesnot have a main but has methods. Then create a client program to run the object, this one has a main, neither program will compilied.

I have both the class program call TP1.java and the client program TP1Client.java in the same directory.

public class TP1Class {

··· public static void main() {

········· TP1 tempProsStation = new TP1(74,1,10,true,true,true,true);
·
········· tempProsStation.tPRun(false);

········ } //end main

· } //end class TP1Client

the error message:

····· [noparse][[/noparse]Java Error] TP1Client.java(0): Warning: "c:\document_and_Settings\Student\capstone_jan_2008\Paul\TP" is either not a valid zip file or it contains a zip file comment. if it contains a comment, rezip it without a comment.

····· [noparse][[/noparse]Java Error} TP1Client.java(5) Error type TP1 was not found

···· [noparse][[/noparse]Java Error] TP1Client.java(5) Error no match was found for constructor.etc

the constructor has parameters int, int, int, boolean,boolean,boolean,boolean

I thought the problem is something to do with creating a package. Advance topic

also I added the path to the [noparse][[/noparse]options] classpath ...;c:\document_and_Settings\Student\capstone_jan_2008\Paul\TP· That's the directory that has the two programs

finally I tried in the TP1 program adding befor the import
package document_and_Settings.Student.capstone_jan_2008.Paul.TP ( I hade to put the underscore in

no luck

HELP

Paul cognig@aol.com

·

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-04-10 22:58
    If you add·c:\document_and_Settings\Student\capstone_jan_2008\Paul
    to classpath and have a folder TP inside folder Paul,
    then you should use
    package TP;
    and
    import TP.*;

    This is analogue to:
    The standard classpath holds c:\program files\Parallax Inc\Javelin Stamp IDE\lib
    which holds a folder stamp which holds a folder core.
    So you use
    import stamp.core.*;

    regards peter
Sign In or Register to comment.