I'm trying to install RapidMiner Studio and I'm having problems related with Java, running the installation file RapidMiner-Studio.sh in my terminal (OS Ubuntu 18.04). I think I have all the requirements to install RapidMiner. I found out I had to have Java 8 or OpenJDK 8, so I installed and configured as explained here. Also, from the same source's suggestions, I added this in the .sh file: --add-modules=java.xml.bind (after eval \"$JAVA\"). Like this:
if [ $# -gt 0 ]; then
eval \"$JAVA\" --add-modules=java.xml.bind $JVM_OPTIONS -cp \"${rmClasspath}\" com.rapidminer.launcher.GUILauncher \"$#\"
else
eval \"$JAVA\" --add-modules=java.xml.bind $JVM_OPTIONS -cp \"${rmClasspath}\" com.rapidminer.launcher.GUILauncher
fi
My OpenJDK version is this:
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
So, the errors I got from the installation file (after doing chmod +x RapidMiner-Studio.sh and ./RapidMiner-Studio.sh) are the following:
Error: Could not find or load main class com.rapidminer.launcher.JVMOptionBuilder
Unrecognized option: --add-modules=java.xml.bind
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
It's clear it doesn't recognize the added module java.xml.bind.
So without that added module in the .sh file, I removed it. And running, I got the following errors:
Error: Could not find or load main class com.rapidminer.launcher.JVMOptionBuilder
Error: Could not find or load main class com.rapidminer.launcher.GUILauncher
How can I solve this Java problem?
Thank you for your attention.
I'm answering my question. So, to solve this, I simply had to replace the original line rmClasspath="${RAPIDMINER_HOME}"/lib/* with rmClasspath=./lib/*. This wasn't about the Java, but really the shell script. I had defined RAPIDMINER_HOME previously and somehow itwasn't reconized in that if statement.
Related
I am trying to install rJava to conduct MaxEnt (Dismo package) on the servers of a super computer that run Linux. All the other packages have been successful, but rJava continues to give errors.
I have followed the answers from this thread including adding jre to my file path, using R CMD javareconf, and installing a new JDK and specifying that as the $JAVA_HOME. Unfortunately, I cannot use the apt-get function because of my role on the servers, although I believe this would be the best solution since it will correct my necessary file paths. However, perhaps I am missing something else that is causing the error.
This is the Java Version I am using:
- openjdk version "1.8.0_181"
- OpenJDK Runtime Environment (build 1.8.0_181-b13)
- OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
This is the error msg that is produced
checking whether ~/Core/java/1.8.0_121/bin/javah actually works... no
checking whether javah was replaced by javac -h... no
configure: error: one or more Java tools are missing.
*** JDK is incomplete! Please make sure you have a complete JDK. JRE is *not* sufficient.
configure: error: ./configure failed for jri
ERROR: configuration failed for package 'rJava'
* removing '/home/afila/R/x86_64-pc-linux-gnu-library/3.5/rJava'
The downloaded source packages are in
'/tmp/RtmpvYtNJY/downloaded_packages'
The issue I was having was indeed a permissions problem. Someone helped me resolve it by emulating the root system using proot. After that it was a matter of re-configuring the directory and R's access to it.
In Unix
mkdir ~/etc
cp -a $EBROOTR/lib64/R/etc/* ~/etc
proot -b
R CMD javareconf -e
In R
install.packages("rJava")
library(rJava)
I'm really struggling with this. I've been unable to configure Intellij to use Javac, unable to run javadoc. I just can't seem to get my java runtime environment stable and working productively on Mac OSX.
I've created the most basic of examples which is a hello world program and it still errors from command line. Everything I read about this error tells me to "upgrade the compiler". But I'm really not sure what the problem is, the javac & java are both running 1.8 (now, after I tried upgrading the system JVM).
I explicitly set the path when calling javac, checked the version etc. Everything tells me it's 1.8.
Can anyone explain how to fix this? (without reverting my system to a 1.5 SDK).
This is output from the basic hello world application:
$JAVA_HOME/bin/javac Main.java
Main.java:3: cannot access java.lang.Object
bad class file: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class)
class file has wrong version 52.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class Main {
^
1 error
localhost:mycompany$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
localhost:mycompany$
Output from javac version:
javac -version
javac 1.8.0_45
javac: no source files
Usage: javac <options> <source files>
Output from java version:
java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
The error message means that you try to load a Java 8 class with a Java 5 VM.
For an unknown reason $JAVA_HOME/bin/javac is using the JDK 8 Java runtime (.../rt.jar) but the compiler itself is loaded with a Java 5 VM.
My next step would be to make sure that $JAVA_HOME/bin/javac is actually what it should be (and not a script which does something weird). I'd also check the environment (CLASSPATH) and options like -Xbootclasspath. Try set | grep -i java and set | grep -i path to look for suspicious variables.
If nothing seems to work, try to reinstall the Java 8 SDK again.
I had exactly the same issue with the same versions when trying to build the Arduino IDE using ant. The fix is to remove an old version of tools.jar from /Library/Java/Extensions/ - just wanted to clarify for others that hit the same issue.
I uninstalled java j2sdk1.4.2_12 java on my Linux Server and Install jdk1.6.0_21,
but when I am trying to run any script I am getting following Error
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.
I already set classPath and Path like :
In vi ~/.bashrc
export JAVA_HOME=/home/java/jdk1.6.0_21/
export PATH=$PATH:/home/java/jdk1.6.0_21/bin
export set CLASSPATH=/usr/java/j2sdk1.4.2_12/lib/mysql-connector-java-5.1.6-bin.jar: /home/java/jdk1.6.0_21/jre/lib:/root/mis/mod:$CLASSPATH
ulimit -c unlimited
IN vi ~/.bash_profile
JAVA_HOME=/home/java/jdk1.6.0_21/
PATH=$PATH:$HOME/bin:$HOME/mis/mod:
PATH=/home/java/jdk1.6.0_21/bin:$PATH
CLASSPATH=$CLASSPATH:/home/java/jdk1.6.0_21/lib:.:
export JAVA_HOME
export PATH
export CLASSPATH
unset USERNAME
When I run following Commands
which java
/home/java/jdk1.6.0_21/bin/java
java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)
I am not getting where is the issue.
Can Any one help me ?
I encounter this issue before. It turns out there are 2 javac program sitting on my machine.
They are in /usr/bin/javac and /bin/javac. My system used the /bin/javac one. The right path for me is /usr/bin/javac. Removing /bin/javac helped
I faced the same issue, and it disppeared by just shutting down the CentOS VM and then starting again. Then type in javac command again to check.
I am using Linux Ubuntu 13.10
I am trying to run a script and get the following error:
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar: Success
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
I have:
javac -version
javac 1.7.0_51
java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (7u51-2.4.4-0ubuntu0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
When I run:
echo $CLASSPATH: I get blank output
echo $JAVA_HOME: blank output
Please help me, how to resolve this.
You have to set your CLASSPATH and JAVA_HOME environment variables. Take a look at this:
https://askubuntu.com/questions/186693/how-set-classpath-variable-for-a-folder-in-ubuntu
http://www.wikihow.com/Set-Up-Your-Java_Home-Path-in-Ubuntu
This could be useful as example, replacing the directories by yours:
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/bin"
export CLASSPATH=".:/usr/lib/jvm/java-7-openjdk-i386/lib"
After you compile your code, you end up with .class files for each class in your program. These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader, which is responsible for dynamically loading classes, cannot find the .class file for the class that you're trying to use. It probably indicates that you haven't set the classpath option when executing your code. This link explains how to set the classpath when you execute
I have a simple Swing app compiled with netbeans 7.1.2 on a ubuntu machine which has the java version:
java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.4)
(6b22-1.10.4-0ubuntu1~11.04.1) OpenJDK Server VM (build 20.0-b11,
mixed mode)
jar works great when i use the shell using "java -jar filename.jar" in linux but in
the windows 7 with the java version 1.7.05 i get:
"Error: could not find or load main class"
How do i resolve this issue?
This error usually shows up when you don't include the current directory (.) in the classpath.
If there are any external libraries that you specify when starting the program, then you probably do something like java -jar -classpath dir/library.jar program.jar. Instead, add . to the classpath: java -jar -classpath .;dir/library.jar program.jar
Other possibilities are:
you didn't include a Manifest in the JAR
in the Manifest that you did include, you didn't specify which is the main class, or you did it wrong.