I am trying to write one web app with Ruby on Rails and using elasticsearch there for searching. I know that elastic search internally calls java api's and for that matter of the fact, it needs jdk to be installed on the machine. So, I downloaded java from official oracle website. File 'jdk-8u101-linux-x64.tar.gz' from "http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html".
After the completion of download, I extracted the files from the gz package as suggested by the official documentation but java is still not installed on my machine. I am sure that I am missing something but what?
Installation of the 64-bit JDK on Linux Platforms
This procedure installs the Java Development Kit (JDK) for 64-bit Linux, using an archive binary file (.tar.gz).
These instructions use the following file:
jdk-8uversion-linux-x64.tar.gz
Download the file.
Before the file can be downloaded, you must accept the license agreement. The archive binary can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.
Change directory to the location where you would like the JDK to be installed, then move the .tar.gz archive binary to the current directory.
Unpack the tarball and install the JDK.
% tar zxvf jdk-8uversion-linux-x64.tar.gz
The Java Development Kit files are installed in a directory called jdk1.8.0_version in the current directory.
Delete the .tar.gz file if you want to save disk space.
Copy the full path to jdk1.8.0_version
Edit /etc/profile
Add export JAVA_HOME="paste there the path that you copied"
Add export PATH=$JAVA_HOME/bin:$PATH
Restart your terminal and rerun
You need to set the path where you have untar the jdk-8uversion-linux-x64.tar.gz file
Related
Is it possible to configure JRE in AIX without using installp.
By simply downloading the archive file which contains a complete java directory (like in windows).
And later on, setting environment variables like JAVA_HOME in os (if required).
If yes then please provide me link where I get that archive of jre.
If no then please suggest me to install jre in AIX without overwriting the previous version of java (which is already install in machine)
and environment variables related to installed java.
The only provider of JDK/JRE for AIX is IBM. And as far as I know the only format they provide is in package (to be installed with installp). And AFAIK you can't install it on different place. Moreover this installation will update probably your current installation. And of course will keep all your settings
When I try to compile a .java file, it says "Command javac not found."
I've done a fresh install of Java using an installer downloaded from their website. I've tried the solution on all of the other posts that says to check my path, but it already includes "C:\Program Files (x86)\Java\jre1.8.0_73\bin;" which contains which looks like a ton of utilities - except, there's no javac executable.
I searched my C drive with File Explorer, and couldn't find it anywhere. I've installed and reinstalled, so I think I might just be looking for the wrong thing to compile my programs. Please help!
You have installed the java jre. You need to install the jdk.
The jre (java runtime environment) contains the files needed to run java.
The jdk (java development kit) includes the jre and also all the development utilities.
Go to the download page, and select the jdk.
I had the same problem and with jdk-8u73-windows-i586.exe from the Oracle downloads page - it installed a JRE and no JDK. Solved the issue by downloading jdk-8u74-windows-x64.exe, which installed both a JRE and a JDK.
I want to install apache ant1.8.4 on my centos machine. I've read in the apache website but i didn't really understand how should i do tha. I didn't find the package on their website.
Is there any option to use the yum install command?
There may be a way of installing Ant as a package. On the Apache Ant website, you do it manually. The tarball or zip provided has the entire Ant package installed. It's not that difficult:
Unzip or untar it to a special directory like /opt. I install all third party stuff in /opt on my system. Everything in the zip or tarball will be under the apache-ant-1.8.4 directory, so Ant will be under /opt/apache-ant-1.8.4.
In your .profile, set $ANT_HOME to where Ant was installed (/opt/apache-ant-1.8.4 in the above example. Then, add $ANT_HOME/bin to your $PATH.
Or, my preference, symbolically link all programs under /opt/apache-ant-1.8.4/bin to the /usr/local/bin directory and put that directory in the front of your PATH. This allows you to put all specially installed executables in one directory that can be placed in your $PATH.
That's about it. If you have the Ant executable (It's a shell script on Unix/Linux/Mac, and a batch script called ant.bat on Windows) in your PATH, it should work.
You mentioned you didn't have the Java Development Kit (JDK) installed. This must be installed first since Ant is a Java program. There must be a CENTOS package for Java. If not, you can try http://java.com/en/download/manual.jsp to download Java on your system.
Assuming you already have jdk installed, you could do the following:
cd $HOME
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz
tar xvfvz apache-ant-1.9.2-bin.tar.gz
In .bash_profile, add the following line
ANT_HOME=$HOME/apache-ant-1.9.2
PATH=$PATH:$ANT_HOME/bin
. ./.bashrc_profile
ant -version ##you should see version of ant.
(updated to 1.9.2 for wget)
I'm kinda stuck with compiling a Servlet in Eclipse on Mac OSX 10.10. Code doesn't matter here - it's a simple HelloWorld example. Point is, I need to install J2EE for this and I have a hard time figuring out how.
Now - I went to oracle's web page
http://www.oracle.com/technetwork/java/javaee/downloads/java-ee-sdk-7-downloads-1956236.html
and downloaded the .zip file. Turns out to be some kind of application server called Glassfish. I don't need this. I don't want this. (I wanna deploy my app on a Jetty) Whatever. But where's the J2EE?
In the documentation it reads
To Install the Software
The following procedure describes how to install the SDK distributions using the ZIP file.
Download the distribution file for your platform from the Java EE 7 SDK Downloads page.
Navigate to the directory where you downloaded the file.
Unzip the file.
Solaris, Linux, and Mac OS X systems: unzip zip-file-name
Windows systems: Unzip using your favorite file compression utility.
The Java EE 7 SDK Update 1 or Java EE 7 Web Profile SDK Update 1 is extracted into a new glassfish4 directory under your current directory.
That's pretty much it: http://www.oracle.com/technetwork/java/javaee/documentation/javaee7sdk-install-1957708.html
Yeah - the content looks like a bunch of examples, this glassfish-server-thingy, and some docs.
Now how do I get from here to Eclipse compiling an HttpServlet-class??? Googled for an hour by now - nothing really helped :(
This is similar to How can I create a .msi file for a Java program ? (eclipse) but is specifically about bundling a JRE as well.
I am currently working on building an MSI for my product so it can be installed as an add-on with Windows Home Server. The installer must be a silent MSI installer.
My product depends on Java 1.6. I want to bundle Java inside the MSI but not necessarily install the JRE, simply copying the files to my product directory and executing from there would be fine.
Initially I tried installing the JRE anyway as a first step. I used the JRE's silent installer, however it turned out that because the JRE installs itself via another MSI, under the covers, the one-MSI-installation-running-at-once rule was broken, and so a JRE could not be installed.
So I changed to copying the JRE files instead. I have managed to create an MSI with all the items, but it comes in at a whopping 60MB! That's around 33MB for my app and the rest is the JRE. My normal setup.exe which bundles the JRE is about 30MB, so I am assuming compression is much better in the latter case (I also use Pack200 compression there).
I am using WiX to build the MSI and have compression turned on.
What is the best way to bundle a JRE, with dependent application, inside an MSI?
IMHO you should simply add whole (unpacked) JRE directory to your installer files. Then run your JRE from the given, known path. Many products (for example DB2, Oracle 11g and even WebSphere Application Server) are doing it exactly like this.