OpenProj JAVA_EXE error on Linux - linux

I have installed openproj_1.4-2.deb on my ubuntu. and I'm getting the following err while openinig the same.
Your Java vendor is "Oracle Corporation". To run OpenProj, you need the Sun Java implementation.
The auto-detected Java Runtime used is..
I have tried to fix by editing $HOME/.openproj/run.conf file by updating JAVA_EXE variable. But it is not working.
How can I run openproj on my Linux?
Please help, Thanks in advance.
(sorry for unable to create a new tag, openproj)

Open $HOME/.openproj/run.conf and Change
JAVA_OPTS="-Xms128m -Xmx768m"
To
JAVA_OPTS="-Djava.vendor=Sun -Xms128m -Xmx768m"
then run it, It will work fine.

I'm able to fix this by adding -Djava.vendor="Sun Microsystems Inc." for java command in run_openproj() of /usr/bin/openproj script.
here is the updated function after my change:
run_openproj() {
if [ "$LOG_LEVEL" ] && [ "x$LOG_LEVEL" = "xDEBUG" ]; then
"$JAVA_EXE" $JAVA_OPTS -Djava.vendor="Sun Microsystems Inc." -jar "$OPENPROJ_HOME/openproj.jar" $ARGS > "$LOG_FILE"
else
"$JAVA_EXE" $JAVA_OPTS -Djava.vendor="Sun Microsystems Inc." -jar "$OPENPROJ_HOME/openproj.jar" $ARGS > /dev/null 2>&1
fi
}

I solved it by installing IBM java version. Note the installation directory, by default it is: /opt/ibm/java-x86_64-80/.
Once IBM java is installed it should be configured to be used by OpenProj.
In order to do that run the following command (maybe the installation path should be updated, this is: /opt/ibm/java-x86_64-80/jre/bin/java):
sudo update-alternatives --install /usr/bin/java java /opt/ibm/java-x86_64-80/jre/bin/java 20000
Now check that the configuration has been saved properly, else set it manually with:
sudo update-alternatives --config java
Now check java version with:
java -version
You should get something similar to this:
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 8.0.7.20 - pxa6480sr7fp20-20221020_01(SR7 FP20))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20220929_37824 (JIT enabled, AOT enabled)
OpenJ9 - 02180fe
OMR - 48fc32a
IBM - bf759bf)
JCL - 20220922_01 based on Oracle jdk8u351-b10
Now, OpenProj can be executed properly.
If it fails again you may delete the configuration file:
rm ~/.openproj/run.conf

Related

How do I fix JavaFX runtime components are missing?

I have the following installed on Ubuntu 18.04.1 LTS:
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)
javafx.runtime.version=8.0.161
javafx.runtime.build=b00
However I try to run the sample java application that uses javafx I get the following error:
$ java -jar Untitled.jar
Error: JavaFX runtime components are missing, and are required to run this application
I have tried to run it in Eclipse, Intelli, and in the terminal with the same error.
I have set the classpath
:~$ echo $CLASSPATH
/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar:.
I have copied all of the javafx files to the current directory.
I have tried everything I can find on the internet.
Does anyone know how to fix this?
On Ubuntu 18.04 with openjdk-11-jre and openjfx installed you could use:
% java --module-path /usr/share/openjfx/lib --add-modules ALL-MODULE-PATH \
-jar Untitled.jar
There is more information on how to run JavaFX programs at the openjfx.io site.

Wrong JVM version for Jira

The problem appears on Linux CentOS 7 server. The service jira will start | stop but when I try to run config.sh I get an error, check-java.sh gives the same error .
The error reads like this:
No JRE_HOME or JAVA_HOME environment variable is set - attempting to just run java command
********** Wrong JVM version! You are running with .. but JIRA requires at least 1.8 to run. **********
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
When Running alternatives --config java I get the following:
There is 1 program that provides 'java'.
Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64/jre/bin/java)
Enter to keep the current selection[+], or type selection number:
The solutions tried were:
Modified /etc/environment JAVA_HOME to suit the location of java from jira's default setenv.sh location JAVA_HOME="/opt/atlassian/jira/jre/"; export JAVA_HOME. This solution makes service jira start | stop stop working.
Modified /etc/environment blindly to use every folder from /usr/lib/jvm
java
java-1.8.0
java-1.8.0-openjdk
java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64
java-openjdk
jre
jre-1.8.0
jre-1.8.0-openjdk
jre-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64
jre-openjdk
Tried to update Java but Package 1:java-1.8.0-openjdk-devel-1.8.0.151-1.b12.el7_4.x86_64 already installed and latest version
Nothing to do.
The answer to the problem is comes like this.
Use the path JAVA_HOME="/opt/atlassian/jira/jre/" in /etc/environment
Command source /etc/environment to update the PATH
Do your business.
If to edit 'check-java.sh' file as follows:
java_version=14
echo $java_version
if [ $java_version -ne 8 ] && [ $java_version -ne 11 ] && [ $java_version -ne 14 ]
then
Jira v.8.4.1 is available for computations for Apple macOS Mojave 10.14.6 as in the local early access experiment for Java 14-ea.
After each update event of Jira version OR update event of Java JVM version (in case of update by substituting the whole either software folder) 'check-java.sh' file is better to be updated in those cases as well (also for automation scripts).
This approach with hard coding of the JVM version value for Jira script allows to run Jira version (at least 8.4.1) via newer JVM versions in experimental mode and along with other software as well at single JVM not only limited by and supported by 1.8 or 11 JVM versions without need to install and to maintain two several JVM versions (in case of folder installations) in experimental mode, if other software can use newer JVM, so more Jira data backups are better to apply in small data scoped setting in such mode of usage.

Issue with Netbeans on Linux Mint

I just installed Netbeans using the script on Oracle's website and I'm having some trouble getting it to work. After opening Netbeans I went to open up a simple .java file just to test it out and got this error:
"The JDK is missing and is required to run some Neatbeans modules. Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information."
I have OpenJDK, and I'm not sure what's meant by using the --jdkhome command line option. I also visited the wiki and it's about doing a full installation of JDK, which I don't think I should need to do. Any help is appreciated.
I think it's better to use Oracle Java JDK rather than Open JDK if you want to use Netbeans for java development
You can use this link to set Oracle Java JDK in Linux Mint
So, it's better to follow theses instructions (JDK install) prior to Netbeans install and all things will go well.
Steps:
1-Remove OpenJDK installation
sudo apt-get update && apt-get remove openjdk*
2- Download Oracle JDK you want to install (for example JDK 8)
Download the *.tar.gz one.
example for current version: jdk-8u65-linux-x64.tar.gz
3- Extract the file and create a folder where to move it
tar -zxvf jdk-8u65-linux-x64.tar.gz
sudo mkdir -p /opt/java
sudo mv jdk1.8.0_65 /opt/java
4- Make JDK system default
sudo update-alternatives --install "/usr/bin/java" "java"
"/opt/java/jdk1.8.0_65/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.8.0_65/bin/java
At this stage, you can start the installation of Netbeans IDE and it will automatically detect your Oracle JDK setting
I tested a short HelloWorld Java example, and I don't have any issue.
Here is the setting JDK view in Netbeans:
If you want to add the JAVA Home dir to your system
Proceed like this
You have to be in root mode and then edit this file: /etc/bash.bashrc
and add:
#JAVA HOME
JAVA_HOME=/opt/java/jdk1.8.0_65
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
Reboot your Mint system
Now you'll have javac working in command line...

Java 7 or 8 is required to Run .Jar (Linux)

This is a newly installed centos 6.2 x86_64 I have downloaded java 8u5 rpm for linux to run a .jar file, but I am unable to. I have removed java through terminal through the command "rpm -e jar-1.8.0_05", and have attempted to reinstall it, though I still get the same error. I have also attempted to install java 7u60, but I still get the same error.
I am now on java 8u5, trying to find a fix for this.
Image:
http://i.stack.imgur.com/f0kzk.png
Try running
cd <path to jar file>
/user/java/jre1.8.0_05/bin/java -jar <jarname>

installing java in linux issues

Im trying to install Java in install but for some reason its not working.
I tried the same way as mentioned in this website-http://www.java.com/en/download/help/linux_install.xml#enable
I see Java installed in my desktop when I try this command,
premvidya#ubuntu:~/Desktop$ ls
jre1.6.0_31 jre-6u31-linux-i586(2).bin jre-6u31-linux-i586.bin
but when I try java - version, I get the following error,
premvidya#ubuntu:~/Desktop$ java -version
The program 'java' can be found in the following packages:
* gij-4.3
* java-gcj-compat-headless
* openjdk-6-jre-headless
* cacao
* gij-4.2
* jamvm
* kaffe
Try: sudo apt-get install
bash: java: command not found
Any help would be appreciated.
Why are you trying to manually install java? There is a repository for this, and it's all managed for you. Uninstall whatever you have put on your system manually and install it via command line.
apt-get cache search java
apt-get cache search jdk
or
start Ubuntu Software Center -> search for java.
Once installed via apt-get, the new java commands will be available immediately in your PATH, so long as you haven't removed anything...
#user1050619
Hi user1050619,
I have come across the solution which will work on any version of Ubuntu definitely keeping other java versions intact.
I have used standalone installation of Java.
For this, please download tar.gz version of Java from
Oracle website.
Suppose, your jdk installation tar file at location /home/don/
don#ubuntu ~ $ tar zxf jdk-7u45-linux-i586.tar.gz
don#ubuntu ~ $ sudo bash
[sudo] password for don:
ubuntu ~ # mv /home/don/jdk1.7.0_45/ /usr/lib/jvm/
ubuntu ~ # cd /usr/lib/jvm/
ubuntu jvm # update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_45/bin/java 3
ubuntu jvm # update-alternatives --config java
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 auto mode
1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1071 manual mode
2 /usr/lib/jvm/jdk1.7.0_45/bin/java 3 manual mode
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jdk1.7.0_45/bin/java to provide /usr/bin/java (java) in manual mode
ubuntu jvm # java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Server VM (build 24.45-b08, mixed mode)
and you are done here without any hassles.
Happy programming !!
it should be "apt-cache search java6" or just "apt-cache search java". It'll give you a list of all the package related to java. If you want to install sun's java then you download the java-**.bin file like you did and then run "sudo /bin/sh jre-6u31-linux-i586.bin" That'll run the installer from the sun java you downloaded and begin to install. Answer the question and install the package.

Resources