Cannot launch idea Community Edition under linux. What's MAIN_CLASS_NAME?

(I'm not used to the layout or style of your forum, I don't know where this post will end up. Please put it somewhere relevant.)

Salient point: Can't launch.
Error: Could not find or load main class com.intellij.idea.Main

I have to use intellij idea for my first university course in java. I don't know any java yet. Using archlinux, I wanted to install intellij idea Community Edition as a package, so that I can uninstall / upgrade and have the package manager keep track of files. The ultimate edtition started, but I did't want to go through the pains of registering, then dishonestly fake another account after a month to register yet again.
I use java 7 and /opt/java is in PATH . I can compile and run a HelloWorld.

Running intellijidea at the command line.

Imagine this formatted as code:
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)
Error: Could not find or load main class com.intellij.idea.Main

Same error If I export IDEA_JDK=$JAVA_HOME as intellijidea.sh does. JAVA_HOME is set to "/opt/java". My understanding of idea.sh is that: If IDEA_MAIN_CLASS_NAME is empty, then set MAIN_CLASS_NAME to "com.intellij.idea.Main". I get the same error if I java someThingNotExisting.

The Community Edition didn't come with intellijidea.sh or intellijidea.desktop. I didn't add those to the archlinux pkg. I don't know if this is useful, but here is the PKGBUILD script used to build the archlinux package. It downloads, sets things up in directories that later are copied from when you actually install the pkg. idea.sh is copied to /usr/bin/intellijidea and they don't differ.

Imagine this formatted as code:
# Maintainer: me
# from the ultimate edition version at http://aur.archlinux.org/packages/in/intellij-idea-ultimate-edition/PKGBUILD
pkgname=intellijidea
pkgver=11.1.3
_buildver=117.798
pkgrel=1
pkgdesc="An intelligent Java IDE intensely focused on developer productivity."
arch=('i686' 'x86_64')
url="http://www.jetbrains.com/idea/"
backup=("usr/share/${pkgname}/bin/idea.vmoptions")
license=('Comercial')
depends=('java-environment')
options=(!strip)
        
source=(http://download.jetbrains.com/idea/ideaIC-11.1.3.tar.gz)
md5sums=('b8ae865e3645cfd0a8d16dac481fd25c')

build() {
  cd "$srcdir"

  install -d -m755 $pkgdir/usr/{bin,share}
  cp -a "idea-IC-$_buildver" "$pkgdir/usr/share/$pkgname"
  chown -R 0:0 $pkgdir/usr/share/$pkgname
  find $pkgdir/usr/share/$pkgname -type d -exec chmod 0755 {} ';'
  find $pkgdir/usr/share/$pkgname -type f -exec chmod 0644 {} ';'

  chmod +x $pkgdir/usr/share/$pkgname/bin/idea.sh
  chmod +x "$pkgdir"/usr/share/$pkgname/bin/fsnotifier
  chmod +x "$pkgdir"/usr/share/$pkgname/bin/fsnotifier64

#  install -D -m755 $srcdir/intellijidea.sh $pkgdir/usr/bin/$pkgname
#  install -D -m644 $srcdir/intellijidea.desktop $pkgdir/usr/share/applications/$pkgname.desktop

  install -D -m755 $srcdir/idea-IC-$_buildver/bin/idea.sh $pkgdir/usr/bin/$pkgname
  install -D -m644 $srcdir/idea-IC-$_buildver/bin/idea.png $pkgdir/usr/share/pixmaps/$pkgname.png
  install -D -m644 $srcdir/idea-IC-$_buildver/LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
}

2 comments

As far as I can see your packaging script copies idea.sh to the /usr/bin directory. It won't work that way; idea.sh needs to be run from the IntelliJ IDEA installation directory.

To create a proper launcher script under /usr/bin, use Tools | Create Command-line Launcher after you run IntelliJ IDEA.

0

Thank you, it works, the generated launch script works too. I'll just keep idea in my home dir and launch it from there. I made the problem more complicated than it had to be.

0

Please sign in to leave a comment.