473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting a "cannot access package" error...

blazedaces
284 100+
Hello, it's been a while since I posted on these forums. My issue I think isn't as much in my code as it's in the syntax and structure in references other packages. I'll get straight to it then:

There's a package called "randomX" which, while I don't know if you care to know, has a program that accesses a site called hotbits to produce true random numbers based on radioactive decay. You can look it up if you're any interested.

Anyway, so I'll post the relevant code and errors here:

Expand|Select|Wrap|Line Numbers
  1. /**
  2.  * @(#)MakeRandomAlphaNumerics.java
  3.  *
  4.  *
  5.  * @author 
  6.  * @version 1.00 2008/6/5
  7.  */
  8.  
  9. import java.util.*;
  10. import randomX.*;
  11.  
  12. public class MakeRandomAlphaNumerics {
  13.     private static int lengthOfCode = 8;
  14.     private randomX.randomHotBits random = new randomX.randomHotBits();
  15. ...
Expand|Select|Wrap|Line Numbers
  1. Error message appears at line 14: cannot access randomX
Now the folder which this file is contained within contains the package file (a folder named randomX, inside of which is the class files for randomX and randomHotBits.

I'm not 100% sure on the way the structure of files is supposed to work to ensure java finds the correct classes. I tried adding the location of that randomX package folder to the class path, but that didn't do the trick.

I thought perhaps it was looking at the randomX file contained in the folder, so I removed it, but then it said it couldn't find the randomHotBits program (with a similar looking error message). I even tried removing just randomX. These seem like silly solutions and I'm just grabbing at straws at this point...

Any and all help is very much appreciated, thanks,

-blazed

Edit: I just looked at the build output (I'm using JCreator) and saw this more elaborate error message, perhaps it'll help:

Expand|Select|Wrap|Line Numbers
  1. --------------------Configuration: <Default>--------------------
  2. C:\programs\randomPrograms\MakeRandomAlphaNumerics.java:14: cannot access randomX
  3. bad class file: C:\programs\randomPrograms\randomX\randomX.class
  4. class file contains wrong class: randomX.randomX
  5. Please remove or make sure it appears in the correct subdirectory of the classpath.
  6.     private randomX.randomHotBits random = new randomX.randomHotBits();
  7.                 ^
  8. 1 error
  9.  
  10. Process completed.
Jun 5 '08 #1
3 8684
blazedaces
284 100+
Sorry guys, seems I've found the answer...

Instead of import randomX.* I was supposed to be even more specific and import randomX.randomHotBits as well...

Reason being that just like how if you import the java.* package you're not importing the java.util.* packages...

That was very frustrating...

-blazed
Jun 5 '08 #2
Dököll
2,364 Expert 2GB
Sorry guys, seems I've found the answer...

Instead of import randomX.* I was supposed to be even more specific and import randomX.randomHotBits as well...

Reason being that just like how if you import the java.* package you're not importing the java.util.* packages...

That was very frustrating...

-blazed
Good you found it, frustrated me also some time ago:-) Thanks for letting us know...
Jun 6 '08 #3
r035198x
13,262 8TB
Hello, it's been a while since I posted on these forums. ...[/code]
Welcome back. Hope you won't disappear again.


P.S So where were you? Kidnapped by terrorists?
Jun 6 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Thomas Barnet-Lamb | last post by:
I was wondering if anyone could give me some help with the following. Consider the code snippet: struct qqq{typedef qqq* pointer;}; template<class al> struct foo : public al { template...
7
by: anilcool | last post by:
Hi all. I am running a stored procedure in a loop -- this Stored procedure inserts one record at a time. After inserting about 1326 records, my thread crashes and I get the following error:...
15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
3
by: Jurgen Haan | last post by:
Hi hi. I'd like to gain some knowledge on packages. We're getting an error "SQL0805N Package "NULLID.SYSLH214 0X5359534C564C3031" was not found. SQLSTATE=51002" On our production database....
3
by: Geoff | last post by:
Is it possible to intercept an error message, generated by Access, and replace it with your own warning. For example entering a duplicate entry for a key field? Thanks Geoff
2
by: Prassi | last post by:
Hi All, I am getting this error Package "NULLID.SYSLN30F 0X5359534C564C3031" was not found in my application, Application is a Websphere portet and we normally get this error after executing a...
2
by: kavin | last post by:
we r getting Package "NULLID.SYSLN31E 0X5359534C564C3031" was not found error in our production server.. when v check with "select * from syscat.packages".. that package SYSLN31E is not listed...
12
by: Jordi | last post by:
I'm getting the following error: Software error: Can't locate object method "new" via package "A::B" at /path/file.cgi line 5. My code is basically this: #!/usr/bin/perl -w use strict; use...
6
by: passionateforjava | last post by:
Hi All, I am using struts application wherein I need to import file for some purpose.I have used input type="file" for the same which goes like: <input type="file" id="uploadFile" name="uploadFile"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.