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 does. JAVA_HOME is set to "/opt/java". My understanding of 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 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. is copied to /usr/bin/intellijidea and they don't differ.

Imagine this formatted as code:
# Maintainer: me
# from the ultimate edition version at
pkgdesc="An intelligent Java IDE intensely focused on developer productivity."
arch=('i686' 'x86_64')

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/
  chmod +x "$pkgdir"/usr/share/$pkgname/bin/fsnotifier
  chmod +x "$pkgdir"/usr/share/$pkgname/bin/fsnotifier64

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

  install -D -m755 $srcdir/idea-IC-$_buildver/bin/ $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

Comment actions Permalink

As far as I can see your packaging script copies to the /usr/bin directory. It won't work that way; 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.

Comment actions Permalink

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.


Please sign in to leave a comment.