Categories
discuss

Smalltalk compilers that target either Java, .NET or Ruby

Looking for a Smalltalk compiler that given Smalltalk (Instantiations) will emit either Java bytecode, .NET CLR or Ruby. Not looking for porting utilities as I want to leave the application in Smalltalk.

I have googled for solutions and ran across a company who had a website (http://www.smalltalkmigrations.com/) but it seems as if they are no longer in business and looking for other options.

Answer

As it seems, James Ladd is working on a Smalltalk for the JVM, but it has not yet been releases.

You can follow the project on twitter though: https://twitter.com/smalltalkjvm

Categories
discuss

Your active platform is: JDK_1.6, but the corresponding property “platforms.JDK_1.6.home” is not found in the project’s properties files

I’m a Java noob (but have been programming for 25+ years, and have worked with OO languages from day 1).

All of a sudden I started getting this error:

Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files. 

Not sure what caused this condition, and not sure what Java’s asking me to do. I’m working in the NetBeans IDE. The last thing I attempted to do is add some binary (image) resources to my project.

Answer

It means you haven’t told netbeans where your Java 1.6 installation is. Go into settings, add the JDK (JDK->Add->New), and select the directory above ‘bin’ for your JDK16.

Categories
discuss

Eclipse 3.5 Unable to install plugins

I really don’t know what’s going on with Eclipse 3.5 (3.5.0 or 3.5.1, same issues), but it’s been now 2 days that I’m struggling with Eclipse to find a way to make the plugins installation work via the “Install New Software screen”!!! I have visited a lot of forums and blogs, tried many solutions but in vain: each time the current problem disappears and a new one appears.

I’m trying to make it work at my office, so behind proxy. The best advice I got so far is the one regarding the known issue with NTLM proxies: http://wiki.eclipse.org/ECF_Filetransfer_Support_for_NTLMv2_Proxies. I put in place the hint, but now I have a new error message: Eclipse cannot find the repositories at all… For instance here is what I get now with the Galileo update site itself:

org.eclipse.equinox.internal.provisional.p2.core.ProvisionException: No repository found at http://download.eclipse.org/releases/galileo.
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:380)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:606)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:88)
    at org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.loadMetadataRepository(ProvisioningUtil.java:88)
    at org.eclipse.equinox.internal.provisional.p2.ui.QueryableMetadataRepositoryManager.doLoadRepository(QueryableMetadataRepositoryManager.java:55)
    at org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadRepository(QueryableRepositoryManager.java:195)
    at org.eclipse.equinox.internal.provisional.p2.ui.QueryableRepositoryManager.loadAll(QueryableRepositoryManager.java:108)
    at org.eclipse.equinox.internal.p2.ui.sdk.PreloadingRepositoryHandler$2.run(PreloadingRepositoryHandler.java:71)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Samething with http://download.eclipse.org/eclipse/updates/3.5, or http://download.eclipse.org/tools/mylyn/update/e3.4/ and whatever the site: no one works.

Please somebody help!

PS: Some more details below:

I have the same issue with third party software too… for instance: http://www.epic-ide.org/updates/testing/site.xml…. same error message.

If I go to Preferences > Install / Updates > Available Software Sites, click on whatever the site and on Test Connection I get a ProvisionException with this error message (when I click on details):

Unable to read repository at http://download.eclipse.org/technology/epp/packages/galileo/site.xml. Unable to read repository at http://download.eclipse.org/technology/epp/packages/galileo/site.xml. Server redirected too many times (20)

the solution is: add following lines to your eclipse.ini file (before -vmargs): (verified on 3.5 ; 3.5.1; 3.6.2)

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=myproxy
-Dhttp.proxyUser=mydomainmyusername
-Dhttp.proxyPassword=mypassword
-Dhttp.nonProxyHosts=localhost|127.0.0.1

Answer

We had tons of issues here, namely with the proxy support. We ended-up using Pulse: http://www.poweredbypulse.com/

Pulse has built-in support for a few plugin, however, you can add third-party plugin and even local jar file quite easily.

Strangely it does not always use the built-in Eclipse feature, so sometimes when Eclipse become difficult ( like in our case for the proxy business ), you can work-around it with Pulse.

Categories
discuss

How to obtain CURDATE() / NOW() on a JPA named query?

I want to do a select from table where date = TODAY, on mysql that would be where date > CURDATE(), how do I do this on a JPA named query?

Answer

That depends on your JPA provider. Hibernate, for example, supports current_date function:

from MyEntity where myDateProperty > current_date
Categories
discuss

How to Tell if a Thread Pool is Idle in Java

I have a thread pool created using

   java.util.concurrent.ThreadPoolExecutor

Is there anyway I can wait till the pool is idle? By which I mean all the threads are not running and nothing is waiting in the queue.

I searched the web and all the solutions don’t work for me. For example, I don’t want shutdown the pool so awaitTermination() wouldn’t work. I also know how to getTaskCount() but I don’t want keep polling the pool, which wastes CPU.

This is a large project and I don’t want change all the tasks running in the pool so I am looking for some solution that don’t rely on task cooperation. So latches or barriers don’t work for me.

Answer

You could subclass ThreadPoolExecutor and add hooks with beforeExecute and afterExecute to track task execution however you like, including basic math to count the currently executing tasks. There is also direct access to the Queue with getQueue().

Between these you can easily implement the tracking you ask for. I’m curious what your use case is… what will you do with the pool when it is empty?

Source: stackoverflow
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Privacy Policy, and Copyright Policy. Content is available under CC BY-SA 3.0 unless otherwise noted. The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 © No Copyrights, All Questions are retrived from public domain..