Saturday, July 5, 2014

JLV v.1.3.3 has been released

Update site: https://github.com/rdiachenko/jlv/raw/repo/eclipse

Or Eclipse Marketplace: http://marketplace.eclipse.org/content/jlv

Release notes:
  • fixed problems with hanging on Windows OS
  • fixed null pointer exceptions related to loading and releasing resources
  • server part was improved
  • a new resource manager was provided

    The main project's page:
     https://github.com/rdiachenko/jlv#information

    Saturday, June 14, 2014

    java.lang.IllegalArgumentException while importing guava sources into Eclipse

    Today I encountered a problem with importing guava sources into Eclipse.

    Steps to reproduce:

    0. Checkout guava sources
    1. Import project into Eclipse as "Existing Maven Projects"


    Detected:


    Thursday, January 2, 2014

    TableViewer.refresh(true, false) behaves as TableViewer.refresh(true, true)

    The problem I met is that refresh(true, false) method of org.eclipse.jface.viewers.TableViewer class behaves as refresh(true, true) on Linux platforms.

    I found an opened bug for this case: https://bugs.eclipse.org/bugs/show_bug.cgi?id=414455 but the current SWT 4.3 stable version doesn't contain the fix.

    To overcome this problem temporary (until SWT 4.4 is released) I used "SWT.MULTI" style bit during TableViewer creation.

    I played with different styles, but it is the only way to avoid the problem. "SWT.NONE" didn't help as well because of the logic inside org.eclipse.swt.widgets.Tablet constructor which overwrites "style" parameter:

    Tuesday, July 23, 2013

    Eclipse 4.3: No schema found for the extension point

    PROBLEM: 

    No schema found for the extension point. The warning occurred in "Extensions" tab of plugin.xml file. Look at the following screenshot:


    Tuesday, July 16, 2013

    Eclipse: Internal browser is not available: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]

    PROBLEM: I've got the following error message when was configuring Eclipse after installing a new Fedora 19:

    Error
    Unhandled event loop exception
    org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
    at org.eclipse.swt.SWT.error(SWT.java:4423)
    at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1993)
    at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:701)
    at org.eclipse.swt.browser.Browser.<init>(Browser.java:99)

    SOLUTION: The solution was just install missed lib and restart Eclipse:

    1. $ sudo yum install libwebkitgtk*
    2. Restart Eclipse

    Saturday, July 13, 2013

    Fedora 19 (64-bit) - Installation notes

    1. Install Chrome

    $ sudo nano /etc/yum.repos.d/google-chrome.repo

    [google-chrome]
    name=google-chrome - 64-bit
    baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
    enabled=1
    gpgcheck=1
    gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


    $ sudo yum install google-chrome-stable

    2. Install gnome-tweeak-tool and customize it

    $ sudo yum install gnome-tweak-tool

    To run it, press Alt+F2 and type in 'gnome-tweak-tool'. Simple selecting the options performs the changes.

    3. Add "Open Terminal" to Gnome Context Menu

    $ sudo yum install nautilus-open-terminal

    4. Install rpmFusion reposetory

    $ sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

    Friday, June 14, 2013

    FreeMarker: An open alternative to JSP

    Today I read a good article about FreeMarker - an alternative to JSP: http://www.javaworld.com/jw-01-2001/jw-0119-freemarker.html?page=1

    Some notes about performance which I were looking for:

    - Much like JSP, FreeMarker compiles templates to improve runtime performance. Those templates are stored in memory in a format that leaves placeholders for dynamic data. The controller fills those placeholders with dynamic data from the model. For this purpose, the controller must have access to both the model and the view. Once the dynamic data is retrieved from the model, the controller will print the template to a given output stream.
    - Once templates are compiled, you can process them in parallel, leading to a significant performance boost.

    - For anything other than the most trivial projects, FreeMarker provides a TemplateCache interface, implementations of which act as a repository for precompiled templates.

    - An additional feature of TemplateCache objects is that they automatically reload templates when the template source file has changed. That relieves you of having to start and stop the servlet engine when you need to make changes to the HTML.

    JSP versus FreeMarker (official documentation): http://freemarker.sourceforge.net/docs/app_faq.html#faq_jsp_vs_freemarker

    Wednesday, June 5, 2013

    Debugging JavaScript in Chrome

    Let's have test.html:

    <html>
      <head>
       <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
       <script type="text/javascript" src="fun.js"></script>
      </head>
      <body>
       <button onclick="return simpleFunction();">Click me</button>
       <ul id="testId"></ul>
      </body>
    </html>


    and fun.js:

    function simpleFunction() {
      for (var i=0; i < 7; i++) {
       var html = '<li>' + i + '</li>';
       $('#testId').append(html);
      }
      return false;
    }



    Wednesday, May 22, 2013

    Unsupported major.minor version 51.0

    Today I faced with the following exception:

    java.lang.UnsupportedClassVersionError: com/rdiachenko/blackbox/alg/InsertionSortTest : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    Reason: Java sources were compiled with JDK 7, but were running on the lower JDK 6.
    Solution: use higher (or the same) JDK during runtime and lower (or the same) during compile time.

    Verstion 51.0 in exception message means J2SE 7. Here the list of all versions: http://en.wikipedia.org/wiki/Java_class_file