Solr installation problems on PHP Server (for Drupal) - linux

I just installed Solr on Drupal 7 and now I am trying to run Solr on my server.
when I entered this:-
java -jar start.jar to start Solr, it gave me this error:-
If 'java' is not a typo you can run the following command to lookup the package that contains the binary:
command-not-found java
-bash: java: command not found
I checked if java is installed by typing which java
for which it says:-
which: no java in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin)
My question is:-
How can I install and Run Solr under these circumstances
How can I automatically start Solr after server is restarted in future?
Thanks.

You need to install Java SE 7 first before anything else. I recommend installing both JRE and JDK.
I am sure there are guides for you distro on the internet.

Related

Unrecognized VM option 'ExitOnOutOfMemoryError' when starting Presto

I was following the installation manual for presto.
But when I lanched the presto server from the command line I got this error:
$ bin/launcher run
Unrecognized VM option 'ExitOnOutOfMemoryError'
Did you mean 'OnOutOfMemoryError=<value>'?
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Per #kavehmb's answer on another question, as of June 2019 the way to work around this issue is:
brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8
I suspected the java version was wrong and checked it. I had Java 1.8.0_65-b17.
The documentation for the installation did not mention anything about needed java version. It was hard to find out the needed Java version for the newest Presto version (v0.208)
I updated to the currently newest Java8 version using brew (on Mac).
brew cask install java8
After successful upgrading of Java I had version 1.8.0_181-b13.
Then prestodb could start.

Got "neo4j: command not found" error when installing Neo4j on Linux machine

I tried to install Neo4j1.9.2 on an Ubuntu machine. I downloaded neo4j-community-1.9.2-unix.tar.gz from Neo4j.org and unzipped it. The neo4j file is in the bin directory.
In bin directory, I typed command "neo4j start", got error "neo4j: command not found". I also tried command "sudo neo4j install", after I provided the password, I got same error "neo4j: command not found".
Java has been installed on this machine:
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
You probably don't have . in your PATH, so you need to do ./neo4j start.
If you install neo4j on your system using a package manager (mine is on gentoo using the portage overlay) the command is under /etc/init.d/neo4j. I found these useful in gentoo.
rc-service neo4j start
rc-update add neo4j default
The shell is on the path for all users, but the service is not on the path. This is the case for most services in most linux distributions, unless you have a DIY install.
You can start the neo4j server with:
service neo4j-service start
But, if you are able to access localhost:7474, then the server has already been started. You can check the status with:
service neo4j-service status

How do I configure Oracle Java JDK 7 (not Open JDK) correctly on Ubuntu 11.10 and run a Java Program with referenced JAR files?

I may have multiple questions here, but ultimately I'm trying to compile and run a Java program that references 3rd party JAR files (on Ubuntu Linux) so I thought it was appropriate to keep it to one question.
I'm trying to get Java JDK 7 properly installed and configured to run a simple program on Ubuntu Linux. I'd like to get instructions from an expert that can help me, at the very least, to run a simple Java program from the command line (perhaps a "Hello World" application?). I've only compiled and run Java programs on Windows in the past, so this is new to me. Last night, I read that you have to be careful of not installing the Open JDK, and to install the Oracle JDK. It appears that Ubuntu 11.10 installs Java Open JDK for you when the OS is installed, among others.
I'm running 32-bit Ubuntu, not 64-bit. So I downloaded this Linux JDK file:
jdk-7u4-linux-i586.tar.gz
I unpacked the tarball into /usr/java and then deleted the *.gz file to save disk space. Some tutorials say to install into /usr/java and some say to install into /usr/lib/jvm, so I just picked one and rolled with it. If you have a suggestion on the appropriate install directory, please let me know what you suggest.
I then checked what Java version was installed (below) with the "java -version" command. It did not find the Oracle JDK.
(1) Why didn't the command list the Oracle JDK package I just installed?
mac#UBUNTU:/usr/lib$ java -version
The program 'java' can be found in the following packages:
* gcj-4.4-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install <selected package>
mac#UBUNTU:/usr/lib$
(2) Can you help me with the steps necessary to configure this Linux machine to compile a Java program (finish what I just started)?
(3) Can you help me with the steps to compile a *.java file to create the *.class file?
(4) Can you help me run the Java program--the one we just compiled?
(5) Suppose I want to include multiple *.jar files (3rd party assemblies) in my Java program. How does Java know on Linux where to find these files if they are not in the directory running the Java program referencing them? (I'm only familiar with a CLASSPATH in Windows)
Ubuntu is based on Debian and its apt-get utility. apt-get will list only known packages. The one you installed is just a folder lying on your system and apt-get does not even know about it.
It looks like java is not on your path. So either you create a symbolic link to the java binary in one of the folders of your path (type env to see what's in your path variable), or you add the JDK bin directory to your path (see command export). As a last resort, you can type the absolute path to the java binary, but that's just painful.
To compile, you simply use javac (Java compiler). For example javac Test.java. Make sure that javac is also on your path (or use the absolute path to the java compiler)
To run it, type java -cp . Test (don't forget to type the fully qualified name of your class if you put it inside a package, which is recommended)
When you compile or when you run, use the argument -cp followed by the list of jars you want to use (separated by a ':' on Linux and by a ';' on Windows). You may use wildcards in your classpath (like lib/*.jar) but you may also have to escape the wildcard to avoid shell expansion (like this lib/\*.jar).

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.

installing grails in linux

I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.
I was wondering how to have them available for all sessions.
Any help is appreciated
Thanks
Edit the .bashrc file of the user launching Grails.
Add the same lines as your commands:
GRAILS_HOME=/home/of/grails
export GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin
you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)
Update
The best way to install Grails on Linux/Mac is to use GVM.
GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.
In addition to Grails, you can also use GVM to manage your installation of
Groovy
Griffon
Gradle
vert.x
If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails
you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.
In /etc/profile.d/ create a script name grails.sh:
export GRAILS_HOME=/opt/grails
export PATH=$GRAILS_HOME/bin:$PATH
Change /opt/grails to where you unzipped grails.
This will make it available for all users.
If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line
GRAILS_HOME=/opt/grails
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"
Groovy Grails Installation:
Before starting up install JAVA on linux system
Check java version using command
$> java -version
Install grails on Linux using Installing-a-grails-development-environment-on-linux
Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation
After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command
$> grails -version
Check Environment variable is set or not for Java as well as Grails with command
$> printenv
Create demo application and run the server for Grails using:
$> grails create-app demo
Go to path
$> cd demo/
Run the server
$> grails run-app
Run the server on specific port 9090
$> grails run-app -Dserver.port=9090
Tools and running environment set up for Groovy Grails:
Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool
Select Eclipse package on linux from the above link:
YouTube Video Tutorial:
All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel

Resources