packages and development amateur

I beg you to excuse the style thought-TI-by means of this post. My hope is that other amateur developers can benefit from this thread. In addition, reactions of more advanced java developers will be appreciated.

Ah, life was simple then. Four months ago my amateur, the [http://r0k.us/graphics/SIHwheel.html url] java project Interactive color wheel, had just SIHwheel.java, generating five classes. Put the classes in a jar file and upload it to my site.

Now, the project has 8 source files (split between two directories of brother), 33 class files as well as several support files. Put everything but the sources in a .jar file and upload to my site.

Heh, all that does not even include the HTML main link above.


I decided it was time to increase the maturity of the project and to set up a couple of packets for me. Two of the source files are provided by other people. I had commented statements package because I didn't know how else to make them work with my package-ignorant structure. It is:
D:\progming\java\SIHwheel\AbstractBean.java (borrowed from SwingX project) --> 1 class
D:\progming\java\SIHwheel\ColorTable.java --> 6 classes
D:\progming\java\SIHwheel\HelpBox.java --> 4 classes
D:\progming\java\SIHwheel\QEBeanTableModel.java --> 3 classes
D:\progming\java\SIHwheel\SIHwheel.java --> 15 classes
D:\progming\java\SIHwheel\SIHmanifest.txt
plus a .png image, two .html files, and five .properties files

D:\progming\java\ntc\ColorName.java --> 2 classes
D:\progming\java\ntc\Hilb.java (provided by mathematician friend) --> 1 class
D:\progming\java\ntc\NTC.java --> 1 class

D:\progming\web\r0k.us\www\graphics\SIHwheel.html
For added convenience, I been copied class files from the directory of ntc on the SIHwheel directory and generating the .jar with:
] jar cvfm SIHwheel.jar SIHmanifest.txt *.class *.properties *.html *.png

Primitive, but it all works. I started adding statements of package of java files (and those did uncomment). My package for this project are:

* us.r0k.sihwheel
* us.r0k.ntc

Immediately, I came across problems. I couldn't compile most of the files .java their new tax package. Time to read the directions on the packaging [url http://download.oracle.com/javase/tutorial/java/package/packages.html]. I learned that I'm going to need a CLASSPATH variable (for some reason I did not in Windows 7, but it is always to find the official java classes without problem) and a more robust development tree. This I added:
D:\progming\java\packages\source\us\r0k\sihwheel
D:\progming\java\packages\source\us\r0k\
D:\progming\java\packages\class\us\r0k\sihwheel
D:\progming\java\packages\class\us\r0k\ntc

] set CLASSPATH=D:\progming\java\packages\class
] set SOURCEPATH=D:\progming\java\packages\source
] set MYCLASSES=D:\progming\java\packages\class
(CLASSPATH may well push, but MYCLASSES is specific to a tree only).

This structure makes sense, and it is expandable in the future?

I'm target compilation to java 1.5, and orders of compilation were form:
] javac - target 1, 5-1, 5 ColorTable.java source

The new provision requires orders of compilation to be structure that supports:
] javac-source 1.5-1.5 - MYCLASSES % ColorTable.java % d target

The classes resulting magically end up by in D:\progming\java\packages\class\us\r0k\sihwheel because that ColorTable.java informs the compiler that it is in the package "us.r0k.sihwheel".

Build the .jar, or even in the course of implementation of the programme, now becomes complicated. The classes are more all in the devolopment directory. Instead, they are scattered on the MYCLASSES tree, in four different locations. Resource files are in another location.
D:\progming\java\packages\class\us\r0k\ntc
D:\progming\java\packages\class\us\r0k\sihwheel
D:\progming\java\packages\class\org\jdesktop\beans
D:\progming\java\packages\class\edu\mit\csail\people\jaffer

D:\progming\java\packages\source\us\r0k\sihwheel
I figured out how to run as a program:
] java us.r0k.sihwheel.SIHwheel

It will work but is unable to access resources. It was used to find in the current directory. How a bundled program find resources?

Similarly, I managed, via a very long jar command, to generate a file jar with all the classes and resources inside. It won't work, however, so I don't know if it deems these resources or not. The command 'java-jar SIHwheel.jar' reports a NoClassDefFoundError. I actually tried twice. The first time was with the original manifesto, which said simply:
hand-Class: SIHwheel
"Ah-ah," I thought. "It's a package now! So I modified the manifesto:
hand-Class: us.r0k.sihwheel.SIHwheel
Neither pot could find its main class. How to make this work?

Sorry for the length of this post. My questions are in bold, and I understood a lot of things that could be useful to other java lovers.

-Rich

Published by: RichF December 13, 2010 21:23
removed repeated text

RichF wrote:


Not quite sure I understand. CLASSPATH can represent several branches, separated by a comma (windows). In my case, this is a directory only, but it could develop. Actually a few minutes ago I read that CLASSPATH would usually start with a ".", by specifying the current directory. I.e.

set CLASSPATH=.;D:\progming\java\packages\class

I didn't do that (but I will). That's why I created the separate MYCLASSES environment variable, to specify a single branch.

There may be two types of entry on your classpath, directories and .jar files. The directory continues to be the root of the tree of class, i.e. package directories are added to the path provided.

The. represents the current directory, then do not use it unless the current directory is the root of a tree of the class. Either by the way, don't count on CLASPATH as an environmental variable, does never work correctly in Windows, use a - cp.

When you use the command of the java compiler, javac, the directory you specify in any re - automatically also taste in the path of the class.

>

When you generate a .jar file, you only need to list the directories of first level, cf jar them load recursively.

It doesn't matter if I have copies of all the class files of their package in a single directory locations,

Yes, he does. The pot must take into account the packages directory structure. If you "flatten" the tree that he finds nothing in the jar.

Change directory to the root of your tree of class and

jar cf NTC.jar us

had to do it. (At least without manifest).

If a directory appears in the list of cf jar files, then it is responsible for recursively. In this case, no ambiguity are needed.

>

I hate to sound like a noob, but this kind of times things package could be more trouble than its worth. Let me rephrase. The learning curve to get packages to work is much steeper than expected.

Very few people these days is using the raw command line interface. With an IDE or an Ant it is all handled automatically, and both are available for free.

But it is good to understand the first command line interface.

It is strongly advised not not to use the "default" package at all.

Tags: Java

Similar Questions

  • Yesterday, I have installed, CS4, on, one, new, computer and it, works ok, EXCEPT, I, no, more, have, Contact, sheet, maker and, me, oblong, have, package, print, developer, both, I have, really, need, bogus, v e, help?

    Yesterday, I have installed, CS4, on, one, new, computer and it, works ok, EXCEPT, I, no, more, have, Contact, sheet, maker and, me, oblong, have, package, print, developer, both, I have, really, need, bogus, v e, help?

    Are these third-party plugin, actions or scripts. If they are you need to install in CS4. On this new machine.

  • Package and sign

    Hi all

    I use mac and I tried to package and sign with ripple and this is the error I got

    "Oh Snap!" "Build request failed with the message: [ERROR] CAP exception has occurred.

    Really need help heeeellllppppppp

    Use the search .

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/RAPC-exception-occurred-v-doesn-...

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/Hello-world-app-RAPC-exception-o...

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/error-compiling-WebWorks-app/m-p...

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/problem-with-number-of-files/m-p...

    You probably have a syntax somewhere error...

  • Cannot get my BlackBerry packaged and signed application

    Help, please.

    I am currently submit a deployable package for testing to my clients who are waiting to test the application, and I was stuck with it. During packaging and signing, the progress indicator is stuck at 99%, and the window "Tool of signed" says "Receive the response" all the required signature and doesn't get anywhere.

    I decided to try it with the simple "HelloBlackBerry" application (you know, like "Hello World"), and it does not work either. Note that he had worked until I think that last night. Is there something to do with the BB Signing Server?

    Urgent response appreciated my customers are waiting on the other end.

    Thank you so much in advance.

    It is Java. BlackBerry Java plug-in Eclipse. BlackBerry API 5. Windows XP, packaging for 8520 (but one last question?). Do not worry about that now, however. Another machine was able to package and sign, so I was saved, and the package was delivered to the customer. But it still doesn't on my PC the last time I tested.

    But the project is, and I think this will be my last project of BlackBerry. Honestly, it was a real pain, and we decided to stop accepting the BB development project for good.

    Thanks anyway, The_Anomaly.

    PS since this topic is not really resolved. Do you know what I have to do?

  • Can package and launch of the emulator of the ripple

    Hello

    I am able to build and verify my application using the emulator to ripple. When I try to deploy the application on my PlayBook, I learned that the build succeeded. I also see the bar file successfully created in the output folder. However, I don't see the app on my PlayBook.

    I confirmed that my debugging chips are not yet due and I also checked to make sure that the mode of development and the device password is correct. I also checked that the settings of the emulator of undulation for IP address matches that on the device. I use the developer version of beta of the operating system (2.1.0.560) and use the stand-alone emulator Ripple (not the chrome extension). I develop using the Tablet OS SDK than BB10 sdk currently not support directory and file API calls.

    I don't know what else to try because I do not receive the error messages and the app seems to have been built very well, but fails to install/launch.

    REDA

    Hi Nuno,

    Thanks for the comments. I managed to pack with the extension chrome as well, but he would not launch on the playbook. However, I was able to find a workaround. If I package and install from the command line using bbwp and deploy blackberry, it seems to work correctly. I can live with that for now.

    Thank you

    REDA

    Update: the problem with the emulator of ripple is also solved thanks to this thread.

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/cannot-install-with-ripple-plug-...

  • using ripple to package and sign

    I try to use the "Package and signature" feature in Wellington. However, I get the error message "Oh Snap!" Build request failed with [error] unable to connect application - failed to find signature keys"

    Under settings... I have:

    SDK path: C:\Program search in Motion\BlackBerry WebWorks SDK 2.2.0.15

    The project root: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs

    Archive name: HelloWorld

    Output folder: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\package

    I copied my old signature keys that I used to sign my BB-Java apps with in the folder SDK WebWorks 2.2.0.15\bin. Don't know how to "install" my signature keys.

    Help, please...

    Just found out from the area of developer that is not supported. I have to use the command line.

  • How to test and develop the HTML/Backbone of content viewer on IPad?

    Hello

    I was responsible for developing and modifying the custom HTML/Backbone of content viewer as well detailed and explained by Derek Lu here:

    https://www.Adobe.com/devnet/digitalpublishingsuite/articles/html-default-library.html#

    I can see that by removing the reference to libs/AdobeLibraryAPI.js index.html I am able to 'test' on the desktop.

    <!--

    The DPS library/store API.

    Understand it below should be placed in the comments during the test on the desktop.

    < script src = "libs/AdobeLibraryAPI.js" > < / script >->

    and that the data are bought in XML via the respect and the parse method is called Librarycollection.

    I made the changes to hang the Viewer to bring in some of the folios we develop.

    However, even if it means to test and develop on the desktop in a form since we use JS and spine, there several checks in the code provided to see if ADOBE.isAPIAvailable.

    If this is the case, then the behavior is different than on the desktop, so once the Viewer is packed to the top and put it on the IPad there is a disparity between what you were able to check and test on the desktop version against which is shown on the IPad.

    So the question is... is there a quick way to develop and test on the Ipad... it does not seem a viable option to develop blindly on the desktop and then package the content in Adobe DPS Viewer to check the behavior of these changes on the IPad?

    To reiterate the Viewer is to make use of the spine / js example to provide greater functionality and customization options.

    Thank you in advance.

    Dave

    You can debug remotely using Safari Office. Installation instructions are here a debugging library or a custom storefront iOS | Adobe Developer Connection. When you are debugging on the device you should also load your JS and CSS files remotely. Use SHIFT + CMD + R to reload the files from the web Inspector, ignoring the cache.

  • Packages and poorly Ref Cursor

    SQL Server Developer, I fight with Oracle to say the least. I fought with the poor performance of the extraction of data from the database, but also a multitude of other things. The last number I have is a stored procedure in a package that does not work when run from my .NET code. I have many other packages and stored procedures that are working, but this one is a failure. I don't get any errors, just no data when I should be.

    I would run the toad package and see if it is the stored Proc and packaging, or if there is a problem in my .NET code. My stored procedure accepts a single PARAMETER of type integer, and has two parameters SYS_RefCursor OUT. My SQL uses the parameter (ID field) to select from a table. If I run the select SQL by itself with the hardcoded value ID, it works fine. I can run too where it uses the SQL for open cursors and inserts the data but I can't determine if it worked.

    So, my questions are the following:

    Can I select a Ref_Cursor? I'm trying to do something like that.
    results_cursor SYS_REFCURSOR;
    
    OPEN results_cursor FOR
       SELECT * FROM Person;
    
    SELECT * FROM results_cursor;
    If I could get the 1st issue a response, I can keep up with my next question.

    Thanks in advance.
    Jeff

    Hello

    I don't see an issue of .NET at this point, so you can have the best chance to post in the forum PLSQL, as it seems that if you need help writing a procedure, rather than interacting with a procedure well known in .NET:
    SQL and PL/SQL

    I'm not clear on your question though. Yes, you can read from a slider ref, and you do it by getting him.

    SQL > set serveroutput on

    SQL > declare
    Ref1 2 sys_refcursor;
    3 rec1 emp % rowtype;
    Number 4 NTC;
    5. start
    6. open ref1 for select * from emp;
    7 LOOP
    8 FETCH INTO rec1 ref1;
    9 OUTPUT WHEN ref1% NOTFOUND;
    10 DBMS_OUTPUT. Put_line (' name = ' | rec1.ename);
    11 END OF LOOP;
    12 end;
    13.
    Name = SMITH
    Name = ALLEN
    Name = WARD
    Name = JONES
    Name = MARTIN
    Name = BLAKE
    Name = CLARK
    Name = SCOTT
    Name = KING
    Name = TURNER
    Name = ADAMS
    Name = JAMES
    Name = FORD
    Name = MILLER

    PL/SQL procedure successfully completed.

    SQL >

    Maybe if clarify what you are trying to do or accomplish in "selecting from a ref cursor" it would be useful.

    Greg

  • Is not my CF 7.02 admin "packaging and deployment &gt; ColdFusion Archives (.car)" menu item

    I want to spend my production server (7.02) 8.01, but I can't find the function "create archive of CAR".  It is not in the packaging and deployment appearing in the admin program (there only Archive J2EE).  I've updated a test to 8.01 server (don't care about the configuration settings), but I don't see a tab of the packaging and deployment at all here.  I have a local install of CF 7 and there no tab and function of archive of CAR.  I have to activate to achieve this functionality?  Another way to back up and restore settings for the upgrade to 8.01? (current server: CF 7.02 Standard, Windows Server 2003, IIS)

    Find your license.properties file (it should be in #cf_home #/ lib).

    Replace the serial number with the developer:

    sn=Developer
    

    and restart CF. it should work.

    Mack

  • Hi, I have Internet data in my package and I just switched to iPhone 5 4 s, I have to change my number to my new sim card and all is works well but when I go out I do not receive my internet, No 4 G or 3 G appears in the corner, everything is turned on?

    Hi, I have Internet data in my package and I just switch to an iPhone a 4S 5, I have to change my number to my new sim card and all is works well but when I go out I do not receive my internet, No 4 G or 3 G appears in the corner, everything is turned on?

    Contact your carrier and make sure that your account is configured correctly. Then go to settings/general/to comments and press the network name; This will cause the exceptional carrier updates to install (you will see a dialog box saying if an update is needed). In addition, go to settings/general/reset - Reset network settings if none of these fix. You will lose the WiFi passwords, but nothing else.

  • Compare 'debug deployment' and 'development '.

    What are the differences between debugging deployment and the development version? I read the short text on the deployment of debug version, but this isn't enough for me.

    Is it possible to "blow" and "run selected sequences?

    Or y at - there somewhere a nice table that compares the three versions, basic debugging and development?

    Frank has soon

    Hi Frank,.

    Here's a link: http://www.ni.com/teststand/depcompare.htm

    However this isn't always so satisfactory that I would like to either so let me see if I can explain it.

    The development and deployment of debugging are exactly the same except that you are ONLY supposed to use the debug version for debugging your deployed sequences.  Basically it allows you to have a sequence editor on the deployment computer for the sole purpose of debugging.  That's how I understand it anyway.  You can jump and throw the sequences selected with the debug version.

    Hope that helps,

  • FPGA device configuration, package and speed grade.

    Hello.

    Where can I find the news of grade package and the speed of the FPGA inside of the PXI-7842R? I ask because I want to build a project XPS in the Xilinx XPS and program needs this info.

    I followed the example in the "how to use designs based on Xilinx Microblaze with NI LabVIEW FPGA 2009 and the R-series modules". There, he gives the info for the specific FPGA (PXI-7852R and PXI-7953R) they use. It's a Virtex5, ff676, xc5vlx50, level-1 speed, but the authors do not mention where one can find this info.

    Thank you

    Bill.

    Nevermind, found the info in this way:

    Instruments\LabVIEW national 2010\Targets\NI\FPGA\RIO\R Series\Pxi-7842r

    Bill.

  • Difference between the version of the Runtime and Developer version of LabVIEW.

    What is the LabVIEW Version called the runtime?

    Is this only for the visualization of the screws built in developer version LabVIEW?

    Can't we develop or modify TENS of LabVIEW version screws?

    vaibhavinegi wrote:

    What is the LabVIEW Version called the runtime?

    There is a version of the separate Runtime for each version of LabVIEW.  You can open NI MAX and develop software to see what is installed on your computer.

    Is this only for the visualization of the screws built in developer version LabVIEW?

    Without the development environment, you cannot change screws LabVIEW.  The runtime engine is responsible for actually running the code in order to integrate LabVIEW executables and run them on other machines without the development environment.

    Can't we develop or modify TENS of LabVIEW version screws?

    NO.

  • Packaging and signing in Flash Builder Burrito using 0.9.4 SDK

    Hey guys. I know frankly, there are 1 million post on the forums about this, but I wanted to be sure and had a few questions myself. Good so I used Flash Builder Burrito to sign and package my request. My app is a Mobile Flex Application and I use 0.9.4 SDK. I used the MANY post on this forum through signature and methods of packaging and it worked perfectly, no errors at all. The two files that I got after conditioning and signature was my apps .bar and bar.sign files. I saw in other post to extract the .bar file to see if its signed and if the icon is there. How do you do this will WinRAR or PowerISO to extract this file type. I fear only because all Iv seen post are all saying theres tons of bugs with the packaging and signing using burrito, but all I could see was that they were using the SDK 0.9.3. Should I have a problem with my .bar file? I don't know how to extract my .bar file to view the contents, so I can at least check to make sure that it is signed and packaged properly. Can someone me another message or an article on how to extract the .bar file and check to make sure that its all good to present, RIMM. My previous version was rejected of RIMM is not signed and sent the Bug of version. I have just re-climbed the .bar I got to use the new SDK and had no errors, so I hope this is right. Anyway thanks in advance and any help would be great.

    The .bar file is just a zip file.  It will work any util that allows to read a zip file.  If you need to rename the .bar to a zip file, which is OK, but be sure to rename it before upload.

  • Package and sign Air apps for BlackBerry 10?

    Hello

    I use Flash CS6 and Air under Windows 3.1 to build my apps BlackBerry 10.

    What tools are available to package and sign the apps?

    Thank you.

    Vibes

    There is an AIR application that helps organized all the stages together (Blackberry Tablet OS graphic Help)

    http://supportforums.BlackBerry.com/T5/testing-and-deployment/BlackBerry-Tablet-OS-graphical-aid/TA-...

Maybe you are looking for