Netbeans - refactoring from in a package to the default package

Hello,
I have a problem, I have some JNI code (two .dll's) and a wrapper that connects my java program to an external USB board.
I didn't write the original code, that was done by Mike Peter and the dlls have been compiled so that I can call the JNI functions only in the default package. Whenever I try to put the code in a package of its own, the JNIs stop working. So my problem now is that I want to access this interface class from my code that is in a package.
I don't know how to import the code as a library into my programs package so perhaps a solution might be to de-package my program code so that it can access Mike Peters code.
Trouble is I have used the netbeans GUI editor that does not let me access all the code and I dont know how to refactor the package from being in one to not being in one.
removing the package declartion from my code manually causes lots of errors.
Any ideas?
Mike Peters code downloadable here:
http://www.re-applications.be/downloads/J-K8055-Wrapper.zip
the usb_interface class has no constructor and is not in a package, how do I go about making it a library and importing it?
I'd greatly appreciate it if anyone can help, if more details are needed I can try to provide them but I didn't think it was worth putting up all my code here as there is no real problem with it, just an access issue.

What I really need to do is find a way to import a class from the default package.
I was led to believe that classes in the default package should be readily accessible, however my compiler says otherwise when my code is in a package and the class I want to access can only be accessed when my code is not in a package. This is really frustrating because the GUI editor doesn't like it when the GUI is not in a package... so I either lose and my USB interface doesn't work or I lose and my GUI doesn't work.
help!

Similar Messages

  • Importing from the "default package"

    Hi,
    I've got a class ("A") which contains an inner class ("Inner") in it, and I have another class ("B") which needs to use the inner class. To make the code more readable I would like to import the inner class directly into class "B", so that I could write something like: "Inner in = ...", instead of "A.Inner in = ...".
    The problem is that all of these classes are placed in the "default package", and Java won't let me import without specifying a package in the import path.
    Is there any way to make a reference to the "default package" and use it inside an import?
    Thanks...

    I think that you should avoid using the default package whenever possible, and in this situation you have to avoid using it. I'm curious, what argument do you have against using packages? Also, why not pull that inner class out if it's to be used by other classes? I think that your code will be more readable and maintainable this way. But then again, I'm kind of new myself, so I'd be interested to hear what others have to say.

  • Where is the location of the default package?

    I'm using jdk1.6.0_14. There is a folder src. I guess the folder contains all the default package. And I try to delete the src folder, and then compile and run a simple program:
    import java.util.Scanner;
    public class TesImport {
         public static void main(String[] args) {
              Scanner s = new Scanner(System.in);
              System.out.println(s.nextDouble());
    }...but it still work... Actually, where is the location of the default package?
    Really need your help.
    Thanks

    JoachimSauer wrote:
    georgemc wrote:
    Eclipse defaults to thisSince I'm using maven, I really like the default structure of files there:
    - */src/main/java* is for Java sources
    - */src/main/resources* is for resources
    - */src/test/java* is for Java sources for the tests
    - */src/test/resources* is for resources for the tests
    - */target* contains everything produced by the build
    - */target/classes* contains compiled Java classes from /src/main/java and resources from /src/main/resources
    - */target/test-classes* contains compiled Java classes from /src/test/java and resources from /src/test/resourcesMe too. Presumably you use the Maven plugin to generate Eclipse projects too? One of the things Maven-haters moan about is that it enforces it's own directory structure on you, which quite apart from not being not true, isn't a bad thing anyway. That structure is a pretty sensible default

  • Using classes outside of the default package in OATS 12.3.0.1.0

    Hello,
    OpenScript - Version: 12.3.0.1 Build 376.
    The test fails when I use classes that are not in the default package.
    Here is a simple example:
    TempClass - in the default package, I can create new objects and use it's methods without any errors.
    AlienClass - in another package (which name is anotherPackage) of the same project, I import that package into the script.java but I get an exception while creating new class object:
    "An unexpected exception occurred in the script. Script section: Unspecified. Caused by: ClassNotFoundException occured. anotherPackage.AlienClass "
    import anotherPackage.*;
    public void run() throws Exception {
      TempClass tmp = new TempClass(); // no errors while creating
      info(tmp.generateMessage());           // this method works correctly
      AlienClass al = new AlienClass();
      /* here I've got error
      *An unexpected exception occurred in the script.
      * Script section: Unspecified.
      * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
    There are no such problems in OpenScript Version: 12.2.0.1 Build 223.
    Could you help me, please?
    Best regards,
    Natalie

    Hi, Sri!
    It was not necessary to name the root package "lib" in previous versions of OpenScript (12.2.0.1, 9.X.X).
    Except the default package, my work project in 12.2.0.1 included one main user package named by the testing application (let's call it "myApp"). And other packages and classes were located there.
    For example:
    D:\Development\TestProject\myApp\core\DB.java
    D:\Development\TestProject\myApp\test\Test1.java
    D:\Development\TestProject\myApp\test\Test2.java
    D:\Development\TestProject\myApp\web\common\Authorization.java
    etc.
    Project with such structure worked in OpenScript 12.2.0.1 but doesn't work in 12.3.0.1.
    According to your advice I created a new package - D:\Development\TestProject\lib, moved "myApp" with all included packages and classes into that package and corrected import statements (like lib.myApp.core.* instead of myApp.core.*).
    And then no errors appeared! So thank you very much! But it's interesting, why behaviour of OpenScript concerning package's name has changed?
    As for example from the first message,  import statement was in the same place where OpenScript added others packages during creating a new project. I've just tried to save some space in the message
    The full script.java is:
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.browser.api.*;
    import oracle.oats.scripting.modules.functionalTest.api.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    import oracle.oats.scripting.modules.webdom.api.*;
    import oracle.oats.scripting.modules.adf.api.*;
    import anotherPackage.*;
    public class script extends IteratingVUserScript {
      @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
      @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
      @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
      @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
      @ScriptService oracle.oats.scripting.modules.adf.api.ADFService adf;
      public void initialize() throws Exception {
      public void run() throws Exception {
      TempClass tmp = new TempClass(); // no errors
      info(tmp.generateMessage());     // this method works correctly
      AlienClass al = new AlienClass();
      /* here I've got error
      *An unexpected exception occurred in the script.
      * Script section: Unspecified.
      * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
      public void finish() throws Exception {

  • How to save library symbols' class files in packages that are not the default package?

    Hi,
    I perform the following in Flash CS5 with Flash Builder 4
    1) Create a new library symbol.
    2) Do a RightClick->Properties on the new symbol
    3) Check the options for "Export for ActionScript" and "Export in frame 1".
    4) I write a new name for my class "Class1" and click on the pencil icon "edit class definition" to edit the class.
    At this point my FlashBuilder 4 takes over and opens the "New ActionScript" dialog.
    4) I then click on Package-Browse to select a package e.g. com.mycompany.myfiles as the new class destination.
    The as file is created as com.mycompany.myfiles/Class1.as as everything seems just fine.
    5) I close the ActionScript file and back in Flash CS5 I RightClick on the symbol and select "Edit Class".
    At this time, FB4 suggests again to create the file, ignoring the fact that I already created it before.
    Do you know of a way I can make Flash CS5 remember where I created the file?
    Thanks.

    Hi,
    I didn't remove the project or delete any of the files.
    All I did was create the class file under a package that is not the default package. Then when I clicked on the Flash symbol's "Edit Class" It asked me again to create the same class file.
    Only if I create the class in the default package, it won't ask me to recreate it again.
    Bye,
      RaamEE-IL

  • What is the default package tu put in a data model ?

    Hi,
    I want to call a procedure *"EXTRACTION"* which is located in the default pachkage of my database.
    What shoud i put in my data model? i feel that this line is wrong :
    *<dataTrigger name="beforeReport" source="Extraction"/>*
    Thnaks,
    SAAD

    Hi,
    i have plaeced my procedure directly in my procedure folder not in a package.
    so if im correct, the default package will be nothing so i just put the name of the procedure.
    is that true?
    Tnaks,
    SAAD.

  • Makepkg with custom dwm ends up installing the default package!

    I have a directory where I edit the source of dwm and then run 'makepkg -efi' to build and install my own version.
    I have been doing this for quite a while now, and everything worked fine.
    Then a few days ago I installed the default dwm with pacman to show my freind what it looks like without the patches that I've applied.
    I removed it with pacman afterward, but now when I run the pkgbuild in my customized dwm directory, it ends up installign the default package!
    I had to go into the source and do a striaght 'make install' to get my custom binary installed again.
    Does anyone know what's going on?

    Are you sure that you did not miss the  "-e" there once and have re-extracted the original tarball?

  • Pass the results from a selection formula to the default values for a parameter field

    Post Author: kevans
    CA Forum: General
    Crystal 10 u2013 SQL 2000
    I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all.  BUT I donu2019t want this to be a static list where I type in all 40 depts in the default list, I was hoping I could do something more dynamic such a formula field that says u201C if {group.name startswith u2018ITu2019 then {group.name}u201D and then have the parameter field pull from this source.
    Iu2019m sure this has been answered in a previous post but Iu2019m not finding it.  I see stuff on creating a record selection formula such as u2018if {?group} like u2018IT-Secur*u2019 thenu2026u201D  but this leaves too much room for error if people donu2019t type the name correctly.  Maybe Iu2019m not using the record selection formula correctly?  Sorry if I offend anyone but I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed.

    Post Author: sharonmtowler
    CA Forum: General
    if you are creating the parameters in the rpt file, it will only pull values you enter, or directly from the database
    in the record selection you can do something like this, so if they only enter the first 2 characters it should pick up only the IT etc.
    (if eft(,2)={?parameter} then true else ={?parameter})

  • About the default package

    We all know , in the java.lang package , we don't import .but I want to know whether I can set a package for example "xxxx" , just as "java.lang " . In the later code, I don't import the xxxx package , it can use the class in the xxxx package ?
    Thanks a lot.

    No. The fact that public type names declared in the java.lang package are automatically imported is part of the vm spec. So, unless you write your own jvm, I don't think you'll be able to do this.

  • I upgraded to Firefox 6 random websites are using illegible fonts from my computer instead of the default. No issues with Firefox 5 or any other browser I use. Each time I open Firefox or reinstall it a different illegible font appears. Please help.

    Firefox 6 using incorrect fonts.

    When I delete the font that keeps showing up as the default, a new illegible font appears. The fonts are not 'garbled' they are just decorative typefaces that are being grabbed from my computer. I have never had an issue with my fonts on old Firefox versions or other browsers like chrome, safari, etc., so I don't think the issue is my fonts. I also don't want to have to delete all the fonts off of my computer. I uploaded another photo of when I deleted the font that was appearing before. Please help if anyone has found a solution to this problem with Firefox 6+ :/

  • Why doesn't itunes have 320 kbps listed for ripping audio tracks from CD as one of the default options?

    Now I know you can ignore the defaults and create custom settings for ripping audio from CD's, but I'm curious why the good folks at apple didn't add 320kbps as a default. I figured it would be a default option since 320 kbps seems to be the standard for good quality when it comes to CD rips.
    Am I wrong here? Anyone have any ideas?

    Apple hasn't stated why it's not a default option.
    Suggestions here -> http://www.apple.com/feedback

  • Make firefox handle URLs from other applications, when not the default browser

    I know there is a preference for this SOME WHERE because I saw it. Now I want to change it.
    I want to toggle whether clicking on a URL in some other app (like my email) will be handled by the Macintosh Default Browser (Safari) or by Firefox

    Only the default browser can handle links automatically.<br />
    That is handled by the OS and can't be affected otherwise.
    If you do not want to change to default browser to Firefox then you need to drag the link in a Firefox window or otherwise open the link in the preferred browser.

  • Accessing html field value from pl/sql code, in the same package

    hi friends,
    my pl/sql web application is working fine. but now i need a small requirment.
    ie, basicaly i need to access the user entered value of an element in html based form from pl/sql code, which is developed using pl/sql toolkit.
    Here is the scenario:-
    User entered a value in field1, then navigate to field2, and click a button for list of values,
    when he clicks the button, internaly it is opening a cursor, where i want to pass field1's value to my cursor as a parameter. So in my pls/sql code , i want to access the value of field1. If you know, please help.
    see the snippet of code.
    htp.p('
    function f1()
    if (parseInt(learnIdx) ==1 )
    for i in dev_Need('1')/*here i want to pass html form element value as a parameter */
    loop
    htp.p('content += "<option value='''||a.version_name||'''>'||a.version_name
    ||'</option>''"; ');
    end loop;
    thanks in advance.
    Zameer.N.A

    Hi,
    Here's my suggestion
    If you wanna access the dll check out "external procedures", you can search it everywhere in OTN.
    However it's easier to use Heterogenous Services to connect database with other sources.
    Check out http://asktom.oracle.com/pls/ask/f?p=4950:8:13454621522426176943::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:4406709207206,
    Tak Tang answer on May, 25, 2004 rules!

  • How to generate a html file from a xml file with the default Firefox look and feel

    Hello
    Any xml or xsd file are pretty printed with Mozilla firefox. I would like to generate the equivalent html file, in order to introduce it later in a Word document. Do you use a xslt file ? How can I do this ?
    Best regards

    I would be remiss if I did not point out that the forum software detected your Firefox as version 17. Is that correct?
    Version 17 is not secure; Mozilla discloses [https://www.mozilla.org/security/known-vulnerabilities/firefox.html security flaws] after each new release. Is something holding you back from upgrading to Firefox 31? Please let us know so we can suggest solutions or workarounds.
    If Help > About Firefox shows Firefox 31, you may need to clear the preference that is misreporting your version number. See: [[Websites say that Firefox is outdated or incompatible even though it's the latest version]].

  • How can we generate the java doc for default package

    hello....
    i using Netbeans 6.5 with JDK 1.5 and JRE 1.6. I generated comment and selected generate javadoc option from Netbeans.
    It genearted javadoc for all packages except the default package.Please help me to generate javadoc for default package.

    You need to pass in source filenames (rather than package names) with the javadoc command on the command line. (I don't know if this can be done in NetBeans)
    "I have refined this fix to handle classes in unnamed packages. A link with the label <unnamed package> now appears at the top of the packge list when classes in unnamed packages are specified on the command line."
    stddoclet: Include package info when passing in source filenames (*.java)
    10-Fix Delivered,
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4359386
    Also see:
    stddoclet: Want default (i.e. unnamed) package to appear in package list
    11-Closed, duplicate of 4359386
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4213968

Maybe you are looking for

  • SSRS WebService ReportExecution2005.asmx raised an exception during creating pdf

    Hello, yesterday i created already a task regarding this problem, but i think it was not detailed enough. Since yesterday i tried a lot of things and came to the following result. If we call the WebService ReportExecution2005.asmx with format "PDF" l

  • Adjusting the page information in pdf presets?

    Hi, Is there a way to adjust the information in the "Page information" when creating pdf-files from Indesign (i.e. in the pdf presets)? As you know the defalt is file name and page number and date and time. I would like to include total page number,

  • Data sometimes doesn't display

    When I load data into level 0 members the data doesn't appear on upper intersections. I run a calc all to make sure the numbers roll up, but I only see the data when I expand all dimensions down to level 0. How do I see data at the first intersection

  • Reading an external property file for adapter configurations (How-To)

    One thing that has bugged me is having to change an Adapter's property settings in the context file and then build and re-deploy the bundle to effect those changes. This really becomes a problem when you want to test a bundle in different server envi

  • Camera help please

    I apologize if this is not the correct forum to post this question to. We need to find a remote camera system to watch failing grandma. We need to be able to check in remotely using both iPhone and iPad. We would need 2-3 cameras. Grandma has wireles