Installing Doug Lea's concurrent Package (easy)

Hi,
I'm having trouble getting Doug's package to work, probably because I didn't install correctly. I unzipped into the folder "C:\Java", which created "C:\Java\concurrent", containing all the files. I added this latter folder to my classpath and compiled, from the concurrent directory, using "javac *.java" which successfully created all the .class files. However, a simple test program which begins with the recommended import statement:
import EDU.oswego.cs.dl.util.concurrent.*;
refuses to compile, giving this error:
$ javac Test.java
Test.java:1: package EDU.oswego.cs.dl.util.concurrent does not exist
import EDU.oswego.cs.dl.util.concurrent.*;
^
Test.java:6: cannot access QueuedExecutor
bad class file: C:\Java\concurrent\QueuedExecutor.class
class file contains wrong class: EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
QueuedExecutor exec = new QueuedExecutor();
^
2 errors
Can anyone tell me what I'm doing wrong?
Thanks,
John

I created the directory structure and got my test class to compile. However, I'm now getting a NoClassDefFoundError at runtime at the line where I first create my QueuedExecutor. Test code follows. Thanks for any hints on how to fix it.
John
import EDU.oswego.cs.dl.util.concurrent.*;
public class Test {
     public static void main (String[] args) {
          QueuedExecutor myExec = new QueuedExecutor();
          try {
               myExec.execute(new MyRunnable("hello"));
          } catch (InterruptedException ignored) {}
          try {
               myExec.execute(new MyRunnable("hi"));
          } catch (InterruptedException ignored) {}
class MyRunnable implements Runnable {
     private String mMessage;
     public MyRunnable(String str) {
          mMessage = str;
     public void run() {
          for (int i=0; i<1000; i++) {
               System.out.println(mMessage);

Similar Messages

  • Edit the MSI package - easier way?

    Has anyone found an easier way to edit the package to customize it?  Orca is not cool. .     Long ago when, there used to be visual packages to edit all this stuff.  IE, WinInstall if I remember.   Snapshot your desktop, install the product, snapshot desktop, package the changes into MSI and be done.   Or is this just crazy talk?

    Those tools still exist (e.g. Flexera AdminStudio) but are not free and are overkill since we already have an MSI compiled. ORCA is free and all we need to touch are a few variables in the package.
    Please remember to rate helpful responses and identify helpful or correct answers.

  • Unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64

    I am unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64 bit.Basically installation rollback on Win 7 64 bit image.
    MSI Log File :-
    Property(S): ProductToBeRegistered = 1
    MSI (s) (5C:D4) [17:59:21:784]: Note: 1: 1708
    MSI (s) (5C:D4) [17:59:21:784]: Product: Adobe_CreativieSuite_5_MNT -- Installation operation failed.
    MSI (s) (5C:D4) [17:59:21:784]: Windows Installer installed the product. Product Name: Adobe_CreativieSuite_5_MNT. Product Version: 1.2.0000. Product Language: 1033. Manufacturer: Adobe Systems Incorporated. Installation success or error status: 1603.
    Please let me how to install 64 bit package on Win7 64 bit.
    Thanks in Advance.

    Ok so I downloaded the most current installer CS5.1, My previous installer was version 5.0. It did install fine fully updated to my license version. I just wanted to update in case anyone in the future has a similiar experience. Too bad this advice was not offered by the "experts" here.

  • How to download and Install bos.loc.utf.EN_US Package for the Oracle BI locale setting english-usa language in Windows 7 64bit

    OBIEE 11G Installation error during configuration steps with message "Distributing Repository" failed.
    I searched lot of forums but all they say, install bos.loc.utf.EN_US Package for the Oracle BI locale setting english-usa language. From where we can download this package.
    Thanks in advance.

    But I am assuming that when I make the installer, the 32-bit Run Time Engine is appened with the installer, as show below
    Since from the picture you can see its including the support installers from '\Program Files (x86)\'
    The application runs queries to fetch data from database in SQL server 2008, and for that I am using a Microsoft SQL Native Client 2008 R2 64 bit ( this is the only version that installs on either PC, even the one on which I developed my LV Application).
    I am not using any driver, only toolkits for reports - and for that I un-checked the "Remove unused polymorphic VI instances" when making the executable, otherwise LV throws up an exception that share variable are not being included.
    Yes I did reboot every time after I ran the installation.
    Still getting the same error.

  • I try to download the newest version of iTunes, but get the following message: "Install iTunes.pkg". This package type requires Mac OS X 10.5." What do I do now?

    I try to download the newest version of iTunes, but get the following message: "Install iTunes.pkg". This package type requires Mac OS X 10.5." What do I do now?
    I have Mac OS X 10.4.11, and don't know how to upgrade to 10.5.

    Here are ways to update to Lion (Mac OS X 10.7):
    http://www.apple.com/macosx/how-to-buy/
    It requires you to have Snow Leopard (Mac OS X 10.6) installed, which can be obtained from the Apple Store.
    You being on Mac OS X 10.4 makes it an old system, 10.6 and 10.7 require an Intel processor at least with Lion demanding an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor.
    What system do you have?

  • I installed CS6 and can not package a document in InDesign that I was able to package before.  Pop u

    I installed CS6 and can not package a document in InDesign that I was able to package before.  Pop up widow "Cannot copy nessessary linked file(s)"

    Yes I am using InDesign 8.0.1 does that mean I'm patched to it?
    I got a new MacBook Pro and migrated the InDesign files from my old computer to my new one.  Would the migration change file or folder names?  I was able to package files on my old computer but I was using CS5.5.

  • Getting problem with the new java.util.concurrent package

    i m using the new concurrency package of jdk 1.5 in my code. see the line:
    Executor threadPool = Executors.newCachedThreadPool();
    about this, api doc says Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available
    but i dont find this method to create new threads whenever required. please tell me about this.
    in my code, in some rare cases many threads r created, and very difficult to detect the number of active threads.
    as the previous one failed i tried with another one newFixedThreadPool(int). but here i got another problem. it works successfully but i dont understand what should be the size of the pool. i tried with 1000, it works well, but in a very rare case, it failed also. then i tried with 10000. but i m still confused, i dont know whether it would work always or not. with traditional threads my code never fails.
    please tell me, what should be the size of the pool and also let me know what is the problem with the first one (newCachedThreadPool)

    The thread pool should not be more than 100 threads. Ideally you should only have a small number of threads per CPU. If your threads are not long running it is possible that you could add 10,000 runnables but on start a small number of threads. Note, adding a thread take a non trivial amount of time so while the thread is added, all the others could finish. This could mean the number of threads could be 140 or smaller.
    Have you looked at the code to see what it does?

  • Using ExecutorService class from java.util.concurrent package

    Dear java programmers,
    I have a question regarding the ExecutorService class from java.util.concurrent package.
    I want to parse hundreds of files and for this purpose I'm implementing a thread pool. The way I use the ExecutorService class is summarized below:
    ExecutorService executor = Executors.newFixedThreadPool(10);
            for (int i = 0; i < 1000; i++){
                System.out.println("Parsing file No "+i);
                executor.submit(new Dock(i));
            executor.shutdown();
            try {
                executor.awaitTermination(30, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();However, the code snippet above creates all the 1000 threads (Dock objects) at once and loads them to the executor, and thus I'm worrying about memory leak. I haven't tested it on 1000 files yet but just on 50 small ones, and even if the program prints out "Parsing file No "+i 50 times at once, it executes normally the threads in the background.
    I guess the write way would be to keep the number of active/idle threads in the executor constant (lets say 20 if the thread pool's size is 10) and submit a new one whenever a thread has been finished or terminated. But for this to happen the program should be notified someway whenever a thread is done. Can anybody help me do that?
    thanks in advance,
    Tom

    Ok I found a feasible solution myself although I'm not sure if this is the optimum.
    Here's what I did:
            ExecutorService executor = Executors.newFixedThreadPool(10);
            Future<String> future0, future1, future2, future3, future4, future5, future6, future7, future8, future9;
            Future[] futureArray = {future0 = null, future1 = null, future2 = null, future3 = null, future4 = null, future5 = null,
            future6 = null, future7 = null, future8 = null, future9 = null};
            for (int i = 0; i < 10; i++){
                futureArray[i] = executor.submit(new Dock(i));
            }I created the ExecutorService object which encapsulates the thread pool and then created 10 Future objects (java.util.concurrent.Future) and added them into an Array.
    For java.util.concurrent.Future and Callable Interface usage refer to:
    [http://www.swingwiki.org/best:use_worker_thread_for_long_operations]
    [http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter10/concurrencyTools.html]
    I used a Future[] Array to make the code neater. So after that I submitted -and in this way filled up- the first 10 threads to the thread pool.
            int i = 9;
            while (i < 1000){
                for (int j = 0; j < 10; j++){
                    if (futureArray[j].isDone() && i < 999){
                        try{
                            i++;
                            futureArray[j] = executor.submit(new Dock(i));
                        } catch (ExecutionException ex) {
                            ex.printStackTrace();
                        } catch (InterruptedException ex) {
                            ex.printStackTrace();
                try {
                    Thread.sleep(100); // wait a while
                } catch(InterruptedException iex) { /* ignore */ }
            executor.shutdown();
            try {
                executor.awaitTermination(60, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();
        }Each of the future[0-9] objects represents a thread in the thread pool. So essentially I'm check which of these 10 threads has been finished (using the java.util.concurrent.Future.isDone() method) and if yes I replenish that empty future[0-9] object with a new one.

  • Error "To run a SSIS package outside of SQL Server data tools you must install task name used in package of Integration service or highter.

    Hello Team,
    I am trying to execute a SSIS package from web page. When i try to do that i am getting following error.
    "To run a SSIS package outside of SQL Server data tools you must install <task name used in package> of Integration service or highter."
    In my machine Integration Services are installed and its service is also in running state.
    Please help me on this.
    Thanks,
    Ramesh
    Thanks, Ramesh Arige

    The SSIS package developed using SSIS 2008 Server R2 and Integrations Services 10.0 is exists in my machine. Is this wrong configuration, please help me on this.
    I am using the below code copied from CodeProject
    Thank you so much for responding.
    Ramesh
    Thanks, Ramesh Arige
    Which way are you using from the provided blog? Using 1) C# Code or 2) C# and Stored Procedure?
    Cheers,
    Vaibhav Chaudhari
    MCP, MCTS, MCSA (SQL Server 2012)

  • How can pkg-get resolve and install dependancies for a selected package?

    Hi all,
    i am using pkg-get for installing phpmyadmin an a solaris 10 os.
    when i do "pkg-get -i phpmyadmin", hi try to install apache2 but he cannot because he don't want to install the dependancies for his package
    -bash-3.00# pkg-get -i phpmyadmin
    WARNING: gpg not found
    No existing install of CSWphpmyadmin found. Installing...
    Pre-existing local file phpmyadmin-3.1.2,REV=2009.02.27-SunOS5.8-all-CSW.pkg.gz matches checksum
    Keeping existing file
    Analysing special files...
    Trying to install dependancy apache2
    No existing install of CSWapache2 found. Installing...
    Pre-existing local file apache2-2.2.11,REV=2009.03.29-SunOS5.8-all-CSW.pkg.gz matches checksum
    Keeping existing file
    Analysing special files...
    Trying to install dependancy apache2c
    Error: dependancies for apache2c not up to date.
    You may call pkg-get again with '-v -u apache2c' to see which ones
    Or, call pkg-get with 'upgrade all' to bring all installed pkgs up to date
    ERROR: install of CSWapache2c failed
    ERROR: could not install required dependancies for CSWapache2
    Once dependancies are up to date, call
            /opt/csw/bin/pkg-get -i apache2
    to (re)install
    ERROR: install of CSWapache2 failed
    ERROR: could not install required dependancies for CSWphpmyadmin
    Once dependancies are up to date, call
            /opt/csw/bin/pkg-get -i phpmyadmin
    to (re)installif i want to install apache2c, he don't want, because he don't have the dependancies, etc....it's infernal, i try "pkg-get -u" for upgrade all package, but it's don't resolve any thing.....
    have we a way for configuring pkg-get for installing the dependancies by himself? (like apt-get)
    another pb : when i try to install one of the dependancies, i have the messsage "Les conventions d'administration syst&#65533;me n'autorisent la cr&#65533;ation que
    d'une seule copie du module <CSWggettextrt>. Or, le nombre maximal de
    copies de module admis en m&#65533;me temps et sur le m&#65533;me syst&#65533;me est d&#65533;j
    atteint.
    "sorry it's in french but it said that he don't want to install the package because "the system administrattion convention allow only one copy of the package", it is because it's already installed?
    thank for your help....

    Hi
    For the last problem, what does
    pkginfo | grep gettext
    show?
    Paul

  • My mac has been updated and when i go to install the newest itunes this pops up. 'Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.' how can i fix this so i can get the new itunes?

    my mac has been updated and when i go to install the newest itunes this pops up. 'Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.' how can i fix this so i can get the new itunes?

    Hi
    Try to use "software update" option
    to to apple menu -> software update  or system preference -> Software update
    ( you may try to use an old package  on new system )
    HTH

  • I just got the new ipod touch, however it says i need to download itunes 10.1 however, when i do so... this is what it says Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.

    just got the new ipod touch, however it says i need to download itunes 10.1 however, when i do so... this is what it says Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.
    what do I do?

    From the box the ipod came in:
    System Requirements
    USB 2.0
    iTunes 10.5 or later7
    Mac: OS X v10.5.8 or later
    PC: Windows 7, Windows Vista, or Windows XP Home or Professional (SP3) or later
    Broadband Internet access required; fees may apply"

  • After installing acrobat my Microsoft office package does not work properly, word will not open and in my email i can't select anything with the mouse

    After installing acrobat my Microsoft office package does not work properly, word will not open and when I want to write an email in my outlook email i can't select anything with the mouse. so copy past en delete are not an option.@

    Are you using any MS Office third party Add-ins? Test:  Remove third party Add-ins other than PDFMaker.  Test to see if the MS Office apps run afterward.
    Did you attempt to repair MS Office?  Test:  Go to Add/Remove Control Panel run Repair.
    Finally, have you tried testing to see if it's PDFMaker?  Test: Use the Add/Remove Control Panel to modify the Acrobat installation to remove PDFMaker.  See if MS Office applications launch and behave correctly?

  • XI3.1: How to install Fix Packs and Service Packages

    Hi there,
    I'm a Business Objects newbie
    I'm searching a guide which explains me, how to install Fix Packs and Service Packages for XI 3.1.  And I've one more question: Where can I see the current Service Package in the System?
    Best regards,
    Andreas

    Hi,
    You can refer the Install guide from the below URL for the installation of FP's or SP's for BOE.
    http://help.sap.com/  ---> go to the Business Objects section and select the FP or SP install guide which you want to install.
    -Noor.

  • HT4312 this update will not finish installing It reaches the writing package receipt stage and stalls anybody else have this issue?

    this update will not finish installing It reaches the writing package receipt stage and stalls anybody else have this issue?

    this update will not finish installing It reaches the writing package receipt stage and stalls anybody else have this issue?

Maybe you are looking for

  • Download report problem

    Hi all I have an application used by lot of users with different access rights. I would like to let some of them to download interactive report, and deny it for others. is there any method to do it?

  • Nokia Photo Transfer for Mac - import and export y...

    Hi, Nokia has published new Nokia Photo Transfer for Mac application, which allows importing and exporting photos and videos from Nokia Lumia with Windows Phone 8 smartphones to Mac. - Importing photos and videos from your Nokia Lumia with Windows Ph

  • Evaluating Adobe AIR with RoboHelp

    I'm a former RoboHelp 7 user, and am evaluating RoboHelp 8 for a new employer. I downloaded the app and it appears that Adobe has fixed many of the problems that gave me so much grief in version 7. Now, I'd like to try out Adobe AIR. I installed it,

  • Group Policy not populating IE11's compatibility sites.

    We normally do not allow IE updates, but we got a pallet of new computers with IE11 preinstalled on them from Dell.  I figured now is a good time to get this working in our environment. The issue is that under our group policy settings are not puttin

  • Use TC as library for itunes folder?

    Hello, I have a big Itunes library and is taken to much place in my hd. Is there any way to use the TC as the principal library so I can delete the one I have in my Mac? Other question is, can i make a partition in the TC? Regards Alex