472,791 Members | 1,086 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 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 8513
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"...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.