The package edu.unm.cs.cs251spr12.lab.feb8 does not exist. I checked out the entire public svn repo a few minutes ago and there is no cs251spr12 or feb8 directory. No Vehicle.java, Engine.java, Tire.java, or VehicleDemo.java files either.
I've noticed that there exist duplicate nested copies of some parts of the repo. There also appear to be entire duplicates of the feb1 package...
The package edu.unm.cs.cs251spr12.lab.feb8 does exist in the repo. I just double checked. Did you update your svn to the latest version? It should be revision 70.
Thanks Joe, but I'm a bit confused now. At times I've used "svn update" when logged into my CS account to get the latest revision of the entire class repo, but usually I use WinSCP to browse to Hayes' pub-svn directory and then copy just the files I want directly to my primary computer.
Using "svn update" I know have the feb8 lab files, but these are nowhere to be found in Hayes' pub-svn directory. I'm curious as to why this is.
Anyways, obvious solution: use "svn update" from within your CS account.
The directory that the SVN is located in contains information on all of the data that has been committed and changed. You shouldn't browse this directory to check things out. This directory acts more like a database keeping track of changes.
Basically, just use the svn from your own directory that you have checked out.
I was reading over the requirements for the next lab and have thought about throwing exceptions when any negative numbers are entered that are not valid to specify the size of the RAM or hard drive space. However, I cannot find any such exception in the Java API. Would I have to someway have to create an exception of my own to accomplish on the composition?
hello, the issue i am having i believe is with my classpath or package. All my .class files are in the same folder "feb8" and they are all in the same package, but when i go to compile my driver class it cannot find the symbol of say the hard drive class
i guess im just not clear on how to set the hierarchy right any help on this would be great
ok i got the code to compile, but when i try to run the program through my Driver class i get a class not found exception. the class and the driver are in the same directory so i am not sure how to approach this exception
I believe we talked about this after class. Basically, you must have everything in the correct directory. For example, if you have the package edu.unm.cs.jcollard you will have 4 directories. edu/, edu/unm, edu/unm/cs, edu/unm/cs/jcollard. You place all your files in the directory furthest down. This is the package. Finally, when you go to run, you *must* use the fully qualified name from the root directory. For example, if I am in /home/jcollard/workspace/edu/unm/cs/jcollard, I need to run the java command from the workspace directory.
I would type: java edu.unm.cs.jcollard.Driver
This would tell it to look in the folder edu/unm/cs/jcollard for a file called Driver.class. The class *must* contain the package declaration edu.unm.cs.jcollard to work this way.
this is my directory as shown in my term compy386@ubuntu:~/edu/unm/cs/cs251spr12/green4g63/lab/feb8$ ls Driver.class Driver.java~ HardDrive.class~ Driver.java HardDrive.class HardDrive.java
and here is my package for the classes package edu.unm.cs.cs251spr12.green4g63.lab.feb8;
public class HardDrive{
package edu.unm.cs.cs251spr12.green4g63.lab.feb8;
public class Driver{
and it still will not find a main class when a main method is in the Driver class sorry to be a pain but i just cant figure this out
Are you sure your main method has been declared correctly? If the stub is not exactly correct it won't be able to launch it. If you are still having troubles, you should email me directly with your source code attached so I can help you trouble shoot.
I had tried: public/protected/default void Usage(){stuff}
I was under the impression that public/protected methods could be seen and used by package members, but I'm getting compiler errors when trying to call it from outside the class it was made in.
My interim solution is having each class contain an identical Usage() method, which seems like it's probably redundant.
No, if you make them static, it implies that there is only one value that can be returned. What if you wanted to make multiple different instances of Computer each of which had their own MotherBoard, CPU, and HardDrive? You would not be able to accomplish this if those methods were static.
That makes sense. However, I've run into another issue. All of my .java files are in the package:
'package edu.unm.cs.cs251spr12.batch.lab.feb8;'
When trying to compile my code to generate the .class files, I'm getting the error "cannot find symbol' for almost every one. My code for HardDrive.java and CPU.java compiled fine.
When you compile you need to either type in the whole filepath or cd up to the package directory and compile from there. For example: javac feb8/*.java
If you have your package named correctly in each file they should compile without errors (of the class not found variety - can't guarantee coding quality ;)
The package edu.unm.cs.cs251spr12.lab.feb8 does not exist. I checked out the entire public svn repo a few minutes ago and there is no cs251spr12 or feb8 directory. No Vehicle.java, Engine.java, Tire.java, or VehicleDemo.java files either.
ReplyDeleteI've noticed that there exist duplicate nested copies of some parts of the repo. There also appear to be entire duplicates of the feb1 package...
The package edu.unm.cs.cs251spr12.lab.feb8 does exist in the repo. I just double checked. Did you update your svn to the latest version? It should be revision 70.
DeleteThanks Joe, but I'm a bit confused now. At times I've used "svn update" when logged into my CS account to get the latest revision of the entire class repo, but usually I use WinSCP to browse to Hayes' pub-svn directory and then copy just the files I want directly to my primary computer.
DeleteUsing "svn update" I know have the feb8 lab files, but these are nowhere to be found in Hayes' pub-svn directory. I'm curious as to why this is.
Anyways, obvious solution: use "svn update" from within your CS account.
The directory that the SVN is located in contains information on all of the data that has been committed and changed. You shouldn't browse this directory to check things out. This directory acts more like a database keeping track of changes.
DeleteBasically, just use the svn from your own directory that you have checked out.
I have revision 72 and the files aren't there. Is there another place I can get them?
DeleteNevermind, just found it.
DeleteI was reading over the requirements for the next lab and have thought about throwing exceptions when any negative numbers are entered that are not valid to specify the size of the RAM or hard drive space. However, I cannot find any such exception in the Java API. Would I have to someway have to create an exception of my own to accomplish on the composition?
ReplyDeleteHow about IllegalArgumentException?
Deletehello,
ReplyDeletethe issue i am having i believe is with my classpath or package. All my .class files are in the same folder "feb8" and they are all in the same package, but when i go to compile my driver class it cannot find the symbol of say the hard drive class
i guess im just not clear on how to set the hierarchy right any help on this would be great
thanks
ok i got the code to compile, but when i try to run the program through my Driver class i get a class not found exception. the class and the driver are in the same directory so i am not sure how to approach this exception
ReplyDeleteI believe we talked about this after class. Basically, you must have everything in the correct directory. For example, if you have the package edu.unm.cs.jcollard you will have 4 directories. edu/, edu/unm, edu/unm/cs, edu/unm/cs/jcollard. You place all your files in the directory furthest down. This is the package. Finally, when you go to run, you *must* use the fully qualified name from the root directory. For example, if I am in /home/jcollard/workspace/edu/unm/cs/jcollard, I need to run the java command from the workspace directory.
DeleteI would type: java edu.unm.cs.jcollard.Driver
This would tell it to look in the folder edu/unm/cs/jcollard for a file called Driver.class. The class *must* contain the package declaration edu.unm.cs.jcollard to work this way.
Hope this helps!
This comment has been removed by the author.
Deletei must be missing something very simple here
ReplyDeletethis is my directory as shown in my term
compy386@ubuntu:~/edu/unm/cs/cs251spr12/green4g63/lab/feb8$ ls
Driver.class Driver.java~ HardDrive.class~
Driver.java HardDrive.class HardDrive.java
and here is my package for the classes
package edu.unm.cs.cs251spr12.green4g63.lab.feb8;
public class HardDrive{
package edu.unm.cs.cs251spr12.green4g63.lab.feb8;
public class Driver{
and it still will not find a main class when a main method is in the Driver class sorry to be a pain but i just cant figure this out
Are you sure your main method has been declared correctly? If the stub is not exactly correct it won't be able to launch it. If you are still having troubles, you should email me directly with your source code attached so I can help you trouble shoot.
DeleteSo I made a Usage method for bad arguments, but can't get it to play nicely across the package. Is this normal?
ReplyDeleteIt really depends on what you are trying to do. Could you give a detailed description of your problem?
DeleteI had tried:
Deletepublic/protected/default void Usage(){stuff}
I was under the impression that public/protected methods could be seen and used by package members, but I'm getting compiler errors when trying to call it from outside the class it was made in.
My interim solution is having each class contain an identical Usage() method, which seems like it's probably redundant.
I'm obviously missing something...
Is it a static method? If it is a non-static method, you need an instance of the class to use it.
DeleteTried setting to static. No luck. I might be able to make it to the back half of your office hours tomorrow. If not I'll be redundant.
DeleteAre we allowed to make any of the required methods static?
ReplyDeleteNo, if you make them static, it implies that there is only one value that can be returned. What if you wanted to make multiple different instances of Computer each of which had their own MotherBoard, CPU, and HardDrive? You would not be able to accomplish this if those methods were static.
DeleteThat makes sense. However, I've run into another issue. All of my .java files are in the package:
Delete'package edu.unm.cs.cs251spr12.batch.lab.feb8;'
When trying to compile my code to generate the .class files, I'm getting the error "cannot find symbol' for almost every one. My code for HardDrive.java and CPU.java compiled fine.
Any idea of what may be causing this?
Try
Deleteimport edu.unm.cs.cs251spr12.batch.lab.feb8.*;
Oh, also, HardDrive.java and CPU.java are compiling because they don't call anything from another class, if I remember correctly.
DeleteThanks for the tip, sir. Unfortunately, it still will not compile.
DeleteAt the top of each .java file, I have the following code:
package edu.unm.cs.cs251spr12.batch.lab.feb8;
import edu.unm.cs.cs251spr12.batch.lab.feb8.*;
I tried running my code in eclipse and it worked flawlessly; not sure where I'm going wrong...
When you compile you need to either type in the whole filepath or cd up to the package directory and compile from there. For example: javac feb8/*.java
DeleteIf you have your package named correctly in each file they should compile without errors (of the class not found variety - can't guarantee coding quality ;)
That worked like a charm! Thanks for the help, Zane.
DeleteSo at the top of all our java files we should have "package edu.unm.cs.cs251spr12.batch.lab.feb8;"???
ReplyDeleteYes. Except you should have your username not necessarily "batch".
Delete