Tag Archives: operating system

Installing Intellij IDEA on Mac and Ubuntu

It has been a year since I moved my professional and community development projects from Netbeans to IntelliJ IDEA. Netbeans is still a great IDE and I recommend it over any other open source alternative, but the productivity brought by IntelliJ is so great that the time I’ve saved using this IDE already paid off.

I have IntelliJ installed at home and at the office. It’s the same license but the deal is: you can install it in several computers but use one installation at a time. I use Mac and Ubuntu at home and my experience installing IntelliJ in those platforms was the following:

Installing on Mac

I’m not really going into step by step here. IntelliJ is pretty easy to install on Mac, but I had a problem with the JDK and I’m going to focus on that now. IntelliJ uses the JDK distributed by Apple by default, which is a JDK 6 implementation. Well, this is not a big deal, since we can install the most recent JDK and configure our projects in the IDE to use it instead. But, for some unexplained reason, I couldn’t configure the IDE to start the application server in a JDK different from the one used by IntelliJ (JDK 6). In the image below, you can see I’ve configured JDK 8 to run WildFly, which requires JDK 7 or superior, but it didn’t work.


So, I had to change the JDK used by the IDE. For that, I:

  1. closed IntelliJ;
  2. went to the folder where all applications are installed (/Applications) and selected the file “IntelliJ IDEA ##.app”;
  3. accessed the context menu (mouse click with two fingers) and selected “Show Package Contents”;
  4. opened the file “/Contents/Info.plist” and
  5. located the JVMVersion to change its correspondent value to 1.8*.

After this configuration, I could finally make IntelliJ run Wildfly.

Installing on Ubuntu

The installation on Linux is traditionally more complicated. I wonder why people complain about the low number of Linux desktop users. 🙂 The IntelliJ IDEA download page mentions only two steps:

  1. unpack the “ideaIU-XX.Y.Z.tar.gz” file using the command “tar xfz ideaIU-XX.Y.Z.tar.gz” and
  2. run “idea.sh” from the bin subdirectory.

However, this instructions don’t deliver IntelliJ as delivered in other platforms. People don’t go to the installation folder and execute the file idea.sh. They either create a desktop icon or add the bin directory to the path, but these steps are missing. So, in my understanding, the installation is not completed. To launch IntelliJ from anywhere in the command prompt:

Become the root user:

sudo -i

Move the unpacked folder to “/opt/idea”:

mv ideaIC-XX.Y.Z /opt/idea

Edit the file .bashrc:

gedit ~/.bashrc

Add the following line to the end of the file:

export PATH=/opt/idea/bin:$PATH

Log out and log in to the change take effect.

To add the launcher icon on the desktop, there is a soft and a hard way.

The Soft Way

Fortunately, IntelliJ can help you once you run it for the first time. In the welcome window, select “Configure”:


And then select “Create Desktop Entry”.


That’s it!

The Hard Way

As a good Linux user, you may prefer doing it the hard way, as follows:

Create a desktop file:

cd /opt/idea
gedit idea.desktop    

Copy the content bellow to the file:

      [Desktop Entry]
      Name=IntelliJ IDEA 
      Comment=Integrated Development Environment
      Name[en]=IntelliJ IDEA

Install the desktop file:

desktop-file-install idea.desktop

Create a symlink:

cd /usr/local/bin
ln -s /opt/idea/bin/idea.sh /usr/local/bin/idea.sh

Finally, display the idea icon in dash:

cp /opt/idea/bin/idea.png /usr/share/pixmaps/idea.png

At this point, you will finally feel IntelliJ as an application, integrated with the desktop and always ready to be executed.

The Consequences of Deferring Project Jigsaw

Mr. Mark Reinhold has announced in July 2012 that they were planning to withdraw Project Jigsaw from Java 8 because Jigsaw would delay its release, planned for September 2013 (One year from now). This date is known because Oracle has decided to implement a two years roadmap planning for Java, so September 2013 is actually 2 years after the release of Java 7.

According to Jigsaw’s website…

“The goal of this Project is to design and implement a standard module system for the Java SE Platform, and to apply that system to the Platform itself and to the JDK. The original goal of this Project was to design and implement a module system focused narrowly upon the goal of modularizing the JDK, and to apply that system to the JDK itself. The growing demand for a truly standard module system for the Java Platform motivated expanding the scope of the Project to produce a module system that can ultimately become a JCP-approved part of the Java SE Platform and also serve the needs of the ME and EE Platforms.”

They also say:

“Jigsaw was originally intended for Java 7 but was deferred to Java 8.”

Now they want to defer it to Java 9 🙁 More details of their decision making are available in a Q&A post on Reinhold’s blog. You may read and follow the discussion there. Here is my opinion:

Without Jigsaw, I believe that it’s very difficult to put Java everywhere. Without Jigsaw, the idea of multi-platform is getting restricted to servers in a age of smartphones and tablets. Jigsaw may be “late for the train”, but it is letting Java late for the entire platform ecosystem.

Deprecated installation screenshot
Observing the market, we can see that development is becoming platform-dependent (iOS, Android, etc.) Only Java can beat this trending because of its large experience on multiplatform implementation, and the time to do it is NOW! Otherwise, in 3 or 4 years there will be no Java on devices, and the development community will have enough knowledge to live with that. Therefore, Java will be basically a server-side technology.

The reasoning behind my prediction is the following: mobile devices are limited in terms of resources and a modular JVM would allow the creation of tailored JVM considering the constraints of each device. I put myself in the shoes of those devices manufacturers: “I wouldn’t distribute something in my products that might impact negatively the user experience in terms of performance”. That was the argument (at least the public one) Apple used to avoid distributing the Flash plugin for iOS’s browser. Probably because of that, Adobe definitively gave up Flash on mobile devices. A modular JVM would simplify a lot Oracle’s negotiation with many device players. It would be reasonable for Apple to include Java as a language for iPad and iPhone applications; Google would finally embed the JVM into Android to evolve faster with new Java language features, getting busy just with a module to extend the JVM to specific Android’s capabilities; it would be even possible to save Nokia from bankruptcy 😀

You may wonder whether Apple and Google would ever adopt JVM as a standard runtime platform. Have you heard about opportunity cost? It states that our current choices and activities are actually blocking other possible choices and activities. The tricky part is to chose the opportunity that is least costly or with the highest profit. Having said that, we can see the scenario considering that Java was not an option because it wasn’t modular when those companies made their decisions. If Java was modular and Apple had adopted it, iOS platform would have at least three times more apps than Android. “Java” was in Google’s strategy to catchup with Apple. Only Java could allow Google to do it in such a short period of time. So, it’s not so simple to ignore Java.

Now, Oracle vs. Google: Of course the effort to move Java forward should be economically viable, and in order to use Java, Google would have to spend some money. Unfortunately, Oracle and Google work with different currencies. While Oracle thinks in terms of licenses, Google thinks in terms of advertising. These currencies are incompatible, very difficult to convert, because while license is cost, advertising is profit. Therefore, Oracle would never reach a deal increasing Google’s cost, but it would be possible to get a deal decreasing Google’s profit. In other words, Oracle could have a percentage of Google’s profit on advertising sold through Java apps in order to make Java available for Android. Google makes this kind of deal with a lot of companies like Yahoo, AOL and others. Why not with Oracle?

If Oracle doesn’t give all resources that the JDK team needs to make Jigsaw a reality in Java 8, Oracle will be completely out of the pervasive game very soon. Without breaking the JDK into manageable and efficient pieces, Oracle won’t have arguments to convince the industry that Java is the way to go on the long run.

Before deciding to drop Jigsaw out, I beg Oracle to think about the consequences! They must ignore the fixed release roadmap and accept the difficulty of the task. We can stay happy with Java 7 (it’s not widely adopted anyway) as long as Jigsaw is on the way to Java 8. This fixed release cycle can actually come back after Java 8.

I would love to be wrong and be taken by surprise with an official Oracle’s announcement of the definitive support for JavaFX on Apple and Android devices during the next JavaOne 😉 However, I think the likelihood is very low 🙁

Preparing Ubuntu to Write Latex Documents

That’s a self-reference post that might be useful for you too. I just installed Ubuntu in a new laptop and I was surprised by how easy is to install a Latex editor and the packages needed to compile and render documents. As a Texmaker user, I’m going to explain the installation using this editor.

On Ubuntu 10.04 or higher, go to Applications – Ubuntu Software Center. Type “Texmaker” in the search field on the top right. Texmaker will appear in the list, then you can click on “Info” to get more information about it, as shown in the figure below.

Press “Install” and have Texmaker and its dependencies installed on your Ubuntu system. TeX Live is the Latex system installed. Notice that you don’t have to do anything to install TeX Live, it will just come together with Texmaker. The installation process will take some time because TeX Live is a big package and you will probably need a good internet connection.

Unfortunately, just a basic version of TeX Live is installed and you will probably have problems trying to write some little advanced texts. To handle that, I suggest the installation of additional texlive packages, which are:

  • texlive-bibtex-extra
  • texlive-fonts-extra
  • texlive-fonts-recommended
  • texlive-math-extra
  • texlive-science

Go to System – Administration – Synaptic Package Manager. Use the search box to find the packages above and check them for installation. That’s all you have to do to start writing high quality documents.

Ubuntu 10.04 is coming to my Laptop

I was gradually moving from Windows to Linux in the last years and the definitive migration finally came in November, 2009. Today, all my work is done in the Ubuntu 9.10 operating system (a Linux distribution), running in a Sony Vaio Laptop, with 4GB RAM and dual core. In other words, the fastest machine I’ve ever had, not because of the hardware, but because this operating system doesn’t waste hardware resources as Windows does.

If you use Windows you certainly need an anti-virus. There is no way to use Windows without it, unless you don’t care about losing your work without any reasonable explanation. An anti-virus will demand around 15% of your computer resources. It means you will be 15% less productive while working. There is no need for an anti-virus on Linux. It is secure and simple. No program can do worse things without your clear permission and it has much less alert messages than Windows.

Before entering in this blog you had to turn on your computer and wait a considerable time until you’re able to start using it. Why did you have to wait for so long? Because some heavy applications decided, not always with your permission, to load part of them during the Windows initialization in order to look faster when you start using them. So, after a year using Windows, you certainly installed a lot of applications and your initialization process becomes slower and slower. That’s why your behavior has changed in the last years, by pressing the power button and walking around some time to have a coffee, talking to colleagues, making some table cleaning, and finally going back to work. This doesn’t happen in Linux, so the initialization is always fast.

71.70% of my Blog’s visitors use Windows (blue), 17.67% use Linux (green) and 10% use Mac (orange). Those who use Mac don’t have the same problems that Windows users have, because Mac, as Linux, is based on Unix. The difference between Linux and Mac is basically the usability. This is the quality factor that makes people spend twice more money on the same software architecture of Linux.

Yeah, the usability provided by Linux is not that great. However, it’s gradually changing thanks to Ubuntu, a Linux distribution focused on Linux accessibility, not only user friendly, but also social accessible by making it freely available for use and distribution. They don’t stop improving it. In some days Canonical, the company behind the Ubuntu Linux operating system, will release the version 10.04, which has an improved usability and it is going to definitively change the way how people face Linux for the first time (I recommend this interesting post at CNET about the Linux acceptance). I published a countdown banner on the right bar (you won’t probably see it anymore in a near future), which is making me much more anxious.

Good Ideas for Kenai That Somebody Else Should be Doing Instead

As you already know, Oracle is planning to deactivate Kenai for community developers. Yes, it is sad but let’s move on and spread our code before it is destroyed. It is also time to make public some ideas I’ve been sharing with Sun’s folks last year. I have criticized Oracle for some decisions they have made, that’s true, but I don’t want to criticize and shut up. I have to propose something better and realistic to show that they are lazy thinkers, growing by buying other people’s innovation, not actually doing their own.

I want to discuss 2 ideas. Each one solves a particular need of entrepreneur developers.

  1. I need integrated services to manage my software project and also to deploy it: It would be a mix of SourceForge with Amazon EC2, or Assembla with Google App Engine. Once my code is committed to the server and an integration test is performed, then my application would be automatically deployed in a server. Today, we need at least two different service providers to make it happen and it means more bureaucracy and waste of time. If Oracle or RedHat adopts something like this, the payment for such services would financially support their open-source projects, such as OpenSolaris, Glassfish, JBoss and MySQL.
  2. I’m an expert in my own open-source product, but I need help with its infrastructure: I have a complex and large JEE5 application and my expertise allows me to provide good support in terms of application features and bug fixing. As a matter of fact, my application is using Glassfish as application server and MySQL as database. However, all I know about these technologies are enough to develop and deploy the application. If a critical error occurs, avoiding the application to run because of an external and unexpected problem, probably my own knowledge is not enough. In order to solve that, Oracle or RedHat would make a partnership with developers, providing services that complements developer’s services. Considering RedHat, the customer would pay directly to them for the services and RedHat would transfer part of the payment to the developer, who provided part of the service too. With this deal, every developer becomes a potential retailer of RedHat’s services. That’s one more solution to increase investments on open-source projects.
Both ideas above were explained to Sun engineers some months ago (At the time I was thinking that IBM would by Sun :D).  To sell open source products, companies should innovate, however Sun was good when innovating their products, but not their selling and services processes. These parts of their business were always traditional. RedHat, on the other hand, has far better selling and services processes for their open source products than Sun because they are agile, have simple procedures and minimal distance between the customer and the specialist. That’s why they are one of the only companies to get profit from open-source.

Companies that already offer software project management (track system, version control, wiki, etc.), such as AtlassianCollabnetGoogle or even Oracle with Kenai, have strategic advantage because they already have something done, with large experience on it. I only wish that people out there get this idea and make it happen. This is not what I love to do, so I won’t appropriately exploit it. But I’m confident that these are good ideas and I hope to blog about any future service that provides such features and I’m probably going to be one of the first customers of the pioneer.