LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   What do i do with .jar files (https://www.linuxquestions.org/questions/fedora-35/what-do-i-do-with-jar-files-208616/)

joeman3429 07-23-2004 02:39 AM

What do i do with .jar files
 
i downloaded a java game and i think i have to do something with the .jar fiiles to install/play it. the problem is, i don't know what to do. i've figured out .bin's and .rpm's but i don't have any idea how to use java files.

thanks for any assistance:)

Quis 07-23-2004 03:19 AM

jar files are compiled and packaged java-code.

you can run it with:
java -jar JAVAJARNAME.jar

try java -h for more help

joeman3429 07-23-2004 03:27 AM

ok, it says
bash: java: command not found

i'm no expert but does that mean i have to install something? if so, what exactly do i download?

Quis 07-23-2004 05:21 AM

Quote:

Originally posted by joeman3429

bash: java: command not found

this means that your java interpreter is not in you path, or you don't have java installed.

Quote:


.. but does that mean i have to install something? if so, what exactly do i download?

you have to install the java runtime environment "J2SE v 1.4.2_05 JRE"
you can get it from here: http://java.sun.com/j2se/1.4.2/download.html

joeman3429 07-23-2004 05:53 AM

ok, i installed it, but it still doesn't recognize 'java'. what about the interpreter not being in my path? what does that mean, and what do i have to do?

thanks for the help:)

Quis 07-23-2004 06:30 AM

open a console and type $PATH
this returns all variables set in PATH. The PATH enables you to call a binary in e.g. /usr/bin without specifying the whole path of the binary.

you can add a directory to your PATH - var in your ".bash_profile" like this:
- open a console
- type: kwrite ~/.bash_profile &
- append: export PATH=$PATH:</directoy/to/your/jre/bin/folder> (without the brackets)
- save it

it might be nescessary to relogin in your gnome/kde.

joeman3429 07-23-2004 02:51 PM

thanks guys, i really apreciate all the help
:D

joeman3429 07-23-2004 05:12 PM

now i'm installing a bin file and it says that the java vm is not in my path
in the terminal i typed:
kwrite ~/.bash_profile

then i put the path of jvm at the end, this is what is in the file:

Code:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH

export PATH=$PATH: /usr/java/j2re1.4.2_05/bin

i put it on the last line
and when i type $PATH i don't see it listed

any advice

Kristijan 07-24-2004 12:57 AM

I just had the same problem now, give this a shot.

Code:

PATH=$PATH:/path/to/j2re/*  <-- Don't forget the * at the end
Try and run the .bin file again and see how you go. If this works, then you can go about putting it in your .bash_profile if need be.

Kristijan

joeman3429 07-26-2004 12:14 AM

sorry, its taken awhile for me to post back...

this is what i get:

[root@localhost root]# PATH=$PATH: /usr/java/j2re1.4.2_05/*
bash: /usr/java/j2re1.4.2_05/bin: is a directory

i thought the point was for PATH to point to directories, so why do i get the error message. i checked $PATH and its not listed in it.

thanks:)

bluemak 07-26-2004 07:13 AM

You could make a symbolic link to java and stick it in the /bin directory.

vincebs 07-26-2004 11:00 AM

Have you tried leaving out the space between PATH=$PATH: and the java directory?


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