LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java Runtime Environment/BGPlay (https://www.linuxquestions.org/questions/linux-newbie-8/java-runtime-environment-bgplay-717295/)

cdr0124 04-06-2009 07:37 PM

Java Runtime Environment/BGPlay
 
Hi -

I'm trying to download Java Runtime Environment onto Linux in order to run an application called BGPlay (http://www.ris.ripe.net/bgplay/). Every time I try, and it seems as though everything is downloaded, I cannot find it on my computer anywhere and thus the application will not run. Any suggestions would be greatly appreciated.

rylan76 04-07-2009 02:45 AM

Strange... I have the 1.5.0_09 JRE installed on my FC6 and FC10 setups both at home and at work.

All I did was to get the

Code:

jre-1_5_0_09-linux-i586.bin
file from the Sun website. Then, I became root and ran it like this

Code:

# jre-1_5_0_09-linux-i586.bin [enter]
This installed it in

Code:

drwxr-xr-x  7 root  root      4096 Oct 12  2006 jre1.5.0_09
[rylan@development ~]$ pwd
/home/rylan
[rylan@development ~]$

i. e. in my home directory, it created a jre1.5.0_09 folder.

All I then did was to add this to my path variable in BASH, in my .bashrc:

Code:

PATH=$PATH:$HOME/jre1.5.0_09
Then, i was able to run any .jar from the commandline in BASH with

Code:

# java -jar jarname.jar
Hope this helped...

cdr0124 04-07-2009 04:49 AM

I download jre1.6.0.13 and I have it installed and in a subdirectory on my desktop. However, everytime I try to run BGPlay (or anything else envolving Java), it says that I do not have the required plugins. I click on the link and install and then a window pops up saying java runtime environment is not available and to click here to download it. Even without that last part, any idea?

knudfl 04-07-2009 08:00 AM

Welcome to LQ.

Try with this command : echo $PATH

and probably discover, that java is not in your path.

Which 'Linux' are you using ? ? Name and version, please.

"All" Linux's have a default Sun-java or similar, ready
to be installed with the package manager, a java which
just will work after install.
Please only download things not found in the package
collection for that OS.
.....

rylan76 04-08-2009 01:58 AM

See above - the problem you seem to have is that when you try to run a .jar, your system cannot "find" your installed JRE.

As Kundfl suggests, make sure that the path on your desktop where the Java runtime is located, is included in your system-wide $PATH.

Also, I'd suggest rather running the application from a terminal, than trying to run it directly from the desktop with a click on an icon.

This is possible, of course, but then you'd probably have to point the icon to a shell script that first sets up the path to the JRE, and then attempts to run the specified .jar.

cdr0124 04-08-2009 04:11 AM

Thanks for the responses! I'm running Linux on Ubuntu 7.04. I had a feeling it was probably something close to that but I don't know how to fix that. I've never worked with moving things from one directory to another that I've downloaded/installed. I can't imagine its too difficult, I'm just not sure how. Knudfl, I tried to get java using apt-get but couldn't find it, that's why I went to the Sun website to download it.

When I run the command 'echo $PATH', I get: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

rylan76 04-08-2009 04:41 AM

Of course, you can also try to run the .jar without changing your path.

Just specify the path in the command, e. g. if you JRE is in /home/myuser/jre1.5.0_09, and your .jar you want to run is in /home/myuser/somejavaprogram, do this in your terminal emulator:

Code:

$ cd somejavaprogram
$ /home/myuser/jre1.5.0_09/bin/java ./somejavaprogram_s_jar.jar

This way, you avoid that the $path environment variable needs to be used, since you use a fully specified location for the "java" executable.

cdr0124 04-08-2009 06:38 AM

I don't have the .jar file, only an executable and .bin. I would like to know more on how to use PATH if you know how to do that : )

rylan76 04-09-2009 05:32 AM

Well to setup your $PATH in your terminal emulator, try this.

First, open your terminal emulator (xterm or konsole).

I'm assuming you are using BASH in the emulator.

Open the file ~/.bashrc in a text editor. If you assume that your path is /home/rylan/mypath which you want included in the $PATH for your session, add the following line at the BOTTOM of the .bashrc file:

Code:

PATH=$PATH:/home/rylan/mthpath
Then save and close the .bashrc file.

Close your terminal emulator and re-open it.

The path /home/rylan/mypath should now be in your $PATH. I. e. you should be able to be in any directory, and typing a command and pressing enter will cause the $PATH to be searched for the executable / command specified, and this will now include /home/rylan/mypath... i. e. the system will be able to "find" any executable you call from anywhere, that is in /home/rylan/mypath, AND any other directories along with it in your $PATH.

You can see what $PATH you currently have set in your terminal emulator by typing

Code:

$ set | grep PATH
Here's my $PATH, for example:

Code:

[rylan@development ~]$ set | grep PATH
PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rylan/bin:/usr/sbin:./:/usr/bin:/usr/local/include:/home/rylan/povray-3.5:/usr/local/samba/bin/:/usr/local/mysql-standard-4.0.16-pc-linux-i686/bin/mysqladmin:/home/rylan/jdk1.5.0_09/bin/:/usr/local/lib:/home/rylan/jre1.5.0_09/bin:/usr/lib:/usr/local/kde/bin:/usr/local/k3d/bin:/usr/local/mysql/bin:/usr/local/samba/sbin/:/home/rylan/bin:/home/rylan/bin:/usr/sbin:./:/usr/bin:/usr/local/include:/home/rylan/povray-3.5:/usr/local/samba/bin/:/usr/local/mysql-standard-4.0.16-pc-linux-i686/bin/mysqladmin:/home/rylan/jdk1.5.0_09/bin/:/usr/local/lib:/home/rylan/jre1.5.0_09/bin:/usr/lib:/usr/local/kde/bin:/usr/local/k3d/bin:/usr/local/mysql/bin:/usr/local/samba/sbin/
[rylan@development ~]$

And here, for example, is my .bashrc:

Code:

[rylan@development ~]$ vi ~/.bashrc

# .bashrc

# User specific aliases and functions

alias mv='mv -i'
alias ls='ls -lh'

PATH=$PATH:$HOME/bin:/usr/sbin:./:/usr/bin:/usr/local/include:/home/rylan/povray-3.5:/usr/local/samba/bin/:/usr/local/mysql-standard-4.0.16-pc-linux-i686/bin/mysqladmin:/home/rylan/jdk1.5.0_09/bin/:/usr/local/lib:/home/rylan/jre1.5.0_09/bin:/usr/lib:/usr/local/kde/bin:/usr/local/k3d/bin:/usr/local/mysql/bin:/usr/local/samba/sbin/

LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/xine/plugins:/usr/lib
LD_RUN_PATH=/usr/local/lib:/usr/local/lib/xine/plugins

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Lightflow
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.4
export PYTHONHOME=$PYTHONPATH:/usr/lib/python2.4
export LIGHTFLOWPATH=$HOME/Lightflow
export PPMODELER_DIR=/home/rylan/ppModeler

CVSROOT=/usr/local/cvs/; export CVSROOT

CPPFLAGS='-I/usr/local/BerkeleyDB4.3/include'
export CPPFLAGS
LDFLAGS='-L/usr/local/BerkeleyDB4.3/lib'

CFLAGS="-O3 -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -funroll-loops -funroll-all-loops -fforce-addr -finline-functions -frerun-loop-opt -falign-loops=4 -falign-jumps=4 -falign-functions=4 -march=athlon -mmmx -msse -m3dnow"
export CFLAGS

Note the "PATH=" line just under "alias ls='ls -lh'"

Hope this helps,


All times are GMT -5. The time now is 07:09 PM.