Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not new here, but Ubuntu is new to me so here i am..
I'm trying to execute the JAR command to update a jar file.
Code:
jar uf $loc/bin/jar/jinnyintegrator.jar $loc/bin/jar/config.properties
When i execute this script i get the message that jar isn't found.
Even when I do
Code:
which java
i get things i shouldn't get
so i know that java (or jar?) isn't installed appearently (something like openjdk is installed, but i don't know if that matters..?)
So can someone give me the right commands for succesfully install Java (or jar) on Ubuntu 11.04?
It's highly appreciated!
As you said, it looks like your java is not installed correctly.
I don't see any debian package that has /usr/bin/jar. Maybe you should download the jdk from Oracle *vomit noises*. http://www.oracle.com/technetwork/ja...ads/index.html
ciao,
jdk
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513
Rep:
# 6
Quote:
I don't see any debian package that has /usr/bin/jar.
which jar
/usr/bin/jar
ls -l /usr/bin/jar
lrwxrwxrwx 1 root root 21 16 aug 2009 /usr/bin/jar -> /etc/alternatives/jar
ls -l /etc/alternatives/jar
lrwxrwxrwx 1 root root 33 13 dec 2009 /etc/alternatives/jar -> /usr/lib/jvm/java-gcj/jre/bin/jar
But if the command 'java -jar' is used, it's not really a problem,
that "alternatives" use a link to the wrong java version ( java-gcj ) :
java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
→ → → This is the sun-java6-jdk.
# sudo apt-get install sun-java6-jre sun-java6-jre-plugin
Pakketlijsten worden ingelezen... DONE
Boom van vereisten wordt opgebouwd
De status informatie wordt gelezen... DONE
E: Kan pakket sun-java6-jre-plugin niet vinden
i know it is in dutch, but in the last (see bold) it says it cannot find the plugin
any ideas?
#which jar
/usr/bin/jar
#which java
/usr/bin/java
# java version
Exception in thread "main" java.lang.NoClassDefFoundError: version
Caused by: java.lang.ClassNotFoundException: version
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: version. Program will exit.
Also the website of post 5, i did all the commands seperatly and i did not install the plugin because that one gave an error, but the rest is installed.
Can someone explain why i can locate the place where java is installed but when i try to execute it (version) that it fails?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513
Rep:
There is no command : java version
The command is : java -version
( You forgot the hyphen ( - ).
And : Those command should not be run as root.
Root is for administrative tasks only.
Running as root is the fastest way to trash your OS.
+ Makes things unsafe for everybody on the internet, if you are connected.
The command is : java -version
( You forgot the hyphen ( - ).
And : Those command should not be run as root.
Root is for administrative tasks only.
Running as root is the fastest way to trash your OS.
+ Makes things unsafe for everybody on the internet, if you are connected.
.
damn, true, forgot it!! sorry guys
Code:
# java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK Client VM (build 20.0-b11, mixed mode, sharing)
and i see your point of the root problem, but i don't put anything online, it's just for testing and i'm working in a virtual environment so if any goes wrong -> reinstall -> done (but still i know it's probably not the best way to do it, but that is not the issue)
but let's recap
the issue of java is solved, but the problem with the jar command isn't..
So i want to update a jarfile with a file i create.
I create and update the jarfile in the same script, is that the problem?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.