Results 1 to 3 of 3
- 01-01-2010, 07:57 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 3
- Rep Power
- 0
Why wont import jm.util.*; work??
I try to compile my MR.java file from the command line by typing...
"C:\Program Files\Java\jdk1.6.0_17\bin\javac" "C:\Users\gman\Desktop\Java\MR.java"
then when it starts to compile I get errors and it tells me...
package jm.util does not exist.
As far as I understand, if you have java at all this package should exist, so I am assuming it just does not know where to find it. Where do I need to tell it to look to find it?? Thanks!
-Jeremy
p.s. I am not a java programmer, I am a flash action script programmer. I just have this code that was given to me and all I need to do is compile it. This simple task is driving me buggy so any help will be much appreciated.Last edited by cakepizza; 01-01-2010 at 08:01 PM.
- 01-01-2010, 09:26 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
I am not a java programmer, I am a flash action script programmer. I just have this code that was given to me and all I need to do is compile it.
There should be usage instructions from wherever you got the source code. (The presence or absence of such instructions speak to the reliability and professionalism of the code...)
jm is not a standard Java package. That is to say it not provided as part of the Java sdk. Consequently the package and the classes that it comprises must actually be present on your computer (they might be present as a jar file with a name that suggests the jm package: something like jm-2.1.1.jar). Alternatively you might be expected to compile this package yourself: which implies that you have access to its source files. These can be identified as a bunch of .java files inside a subdirectory named jm.
Just having the jm package isn't enough! You have to tell the Java compiler (javac) where it can find the package. This is typically done by providing the javac command a flag specifying the so called "classpath": the list of places that the compiler should look for classes.
Just an example, but suppose that the package did exist as a jar file you were supposed to use and that you put it in the Java directory, then the command might be:
(run where the current working directory is the Java directory itself.)Java Code:"C:\Program Files\Java\jdk1.6.0_17\bin\javac" -cp .;jm-2.1.1.jar MR.java
-----
An alternative is that you are dealing with a typo. Perhaps "jm.util.*" should be "java.util.*" because the latter is a standard Java package.
- 01-01-2010, 11:19 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
cant find the error in the following SQL statemen but it just wont work!!
By nmvictor in forum JDBCReplies: 3Last Post: 10-26-2009, 11:42 AM -
import java.util ????
By kris09 in forum New To JavaReplies: 3Last Post: 08-11-2008, 12:39 AM -
save will work but load wont?!?!
By Sticks_ll in forum New To JavaReplies: 1Last Post: 06-12-2008, 04:19 AM -
java.util.DateFormat not found in import
By christina in forum New To JavaReplies: 2Last Post: 08-05-2007, 10:31 PM -
The import java.util.Scanner cannot be resolved
By Heather in forum Advanced JavaReplies: 1Last Post: 07-08-2007, 01:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks