Buildr doesn't find JAVA_HOME from Intellij - intellij-idea

I have Buildr installed on Ubuntu and it works fine running from command line. I've also installed the Buildr plugin for Intellij IDEA. But I can't run commands such as compile from the IDE. It gives the following message:
/usr/local/bin/buildr compile
(in /path/to/project, development)
Compiling scala-spike
Compiling scala-spike into /path/to/project/target/classes
Buildr aborted!
RuntimeError : Are we forgetting something? JAVA_HOME not set.
But JAVA_HOME is set. The command echo $JAVA_HOME prints the correct path where Java is installed.

Make sure that you are passing JAVA_HOME while starting idea.sh.
Try starting IDEA with sh -c "export JAVA_HOME=/opt/java && $IDEA/bin/idea.sh"

Related

Error : Could not find or load main class

I have compiled the maven project using "mvn install" command.
test.jar file is created in the path of /project/target/test.jar.
I am just trying run the the command "sudo java -jar test.jar".
Getting below error
Error: Could not find or load main class com.xxx.xx.controller.MainApp.
Could you please help to resolve this error.
I am new this technology(maven).
Note: This code I am compiling in ubuntu 20.04 64 bit machine.
Issue is resolved after reinstalling JDK 8.

configure: error: Qtenv cannot find qmake in omnet++ installation

I'm trying to install omnetpp 5.2.1 on windows 10. But getting an error while doing ./configure command related to QT environment. I tried changing the configure.user file in omnetpp package to change the path of QT but still its not working. Here is the error:
configure:error: Qtenv cannot find qmake--maybe it is not in the path
or has some exotic name (tested names were: qmake qmake-qt5 qmake5)-
disabling Qtenv. You can try setting QT_PATH variable in
configure.user to a valid location.
qt5 might not be installed.
sudo apt install qt5-default worked for me while installing on Ubuntu 20.04.
OMNeT++ comes with all dependencies bundled. As long as you have executed the mingwenv.cmd and running from that shell, qmake should be available in the path (in tools/win64/mingw64/bin). Check if qmake.exe is present there. If not, make sure that ZIP file you have downloaded is intact. Standard windows unzip may fail on certain systems...
run ./configure WITH_QTENV = no

build openjdk on mac "JAVA_HOME is not defined correctly"

I am building openjdk on MAC and facing a problem like this:
Error: JAVA_HOME is not defined correctly.
We cannot execute /NO_BOOTDIR/bin/java
the OS of my mac is 10.10.2.
the openjdk is
openjdk-7u40-fcs-src-b43-26_aug_2013
the ALT_BOOTDIR
export ALT_BOOTDIR=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
the $JAVA_HOME
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
when I set JAVA_HOME and run 'make sanity', the error is like this:
ERROR: Your JAVA_HOME environment variable is set. This will
most likely cause the build to fail. Please unset it
and start your build again.
so I have to unset it and no matter I unset it or not, the error appears.
any ideas?
thinks.
Before setting the path make sure that java is installed by checking the directory
/Library/Java/JavaVirtualMachines/<version>.jdk/Contents/Home
Then in .bashrc or .bash_profile
JAVA_HOME=/Library/Java/JavaVirtualMachines/<version>.jdk/Contents/Home
export JAVA_HOME
If it OpenJDK is missing you can install it through brew
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
There should be symlinks in /usr/bin to java and javac

Valgrind: Wrong Version

I downloaded Valgrind 3.7.0 and ran:
./configure
make
make install
However when I run valgrind --version, I get 3.5.0. How is this possible? I am running Mac OS X Lion 10.7. I know I downloaded 3.7.0 because the tar file I downloaded from Valgrind's website name isvalgrind-3.7.0.
What other ways can I check for the version?
By default, valgrind binaries should get installed in /usr/local/bin when you compile from source without providing a --prefix.
(You really just did ./configure && make && make install and had the permissions to install, right?)
See if /usr/local/bin/valgrind exists.
Execute /usr/local/bin/valgrind --version. What is the version?
Execute which valgrind. This should tell you where the valgrind binary is being picked from. Is it the same? My guess is, it is probably not.
Execute echo $PATH to see your path. This gives a : delimited list of directories where bash searches for executables, in the order in which the directories are listed.
My guess is:
There is an existing valgrind installation of the old version, and it shows up in a directory that appears earlier in your $PATH than /usr/local/bin.

Maven RPM Plugin fails to find rpm command in intellij

I have a module I am trying to package as an RPM using Maven RPM plugin. When I run mvn package from the command line, it generates the rpm as expected. When I try to run the package phase from within Intellij, it seems unable to find the rpm command:
[WARNING] /bin/sh: rpm: command not found
...followed later by:
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-1:rpm (default-rpm) on project ve_hive_client: RPM query for default vendor returned: '127' executing '/bin/sh -c rpm -E '%{_host_vendor}'' -> [Help 1]
My hunch is that my rpm installation (/usr/local/bin/rpm) isn't available in Intellij's PATH. Any idea how to add it?
had the same problem on ubuntu. i just installed the rpm program and the PATH then had rpm then.
/usr/bin/rpm
Maven did not complain then
try adding:
PATH=PATH:/usr/local/bin/rpm
in your .bashrc?
Not sure if this will help or not, but worth a try.
If you are running OSX and you've installed rpm using homebrew then it's not related with paths or rpm itself.
In OSX executing
/bin/sh -c rpm -E '%{_host_vendor}'
is different than executing
/bin/sh -c "rpm -E '%{_host_vendor}'"
The latter works pretty well.
Anyone found a way to fix this without changing the plug-in's source code?