[SOLVED] How to execute .jar files in ubuntu linux server
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.
Hi friends...........
I have a .jar file named "server.jar". In windows it executes on simply double click on it but I want to execute it on the server and I don't know how to do it???
I have Filezilla to upload any file on server and putty for cmd prompt.
Plz let me know where i have to upload my file on server and hoto execute it.....
It's urgent plzzzzz make it fast.......
Thanks in advance.................
Assuming you have the Java Runtime Environment installed, you should just be able to do "java -jar filename". You may need to run this as root (i.e. put "sudo" in front).
Also, please don't say your threads are urgent. This is a volunteer site, so nothing is urgent for anyone here.
Assuming you have the Java Runtime Environment installed, you should just be able to do "java -jar filename". You may need to run this as root (i.e. put "sudo" in front).
Also, please don't say your threads are urgent. This is a volunteer site, so nothing is urgent for anyone here.
Sorry for my words frd..
I upload my jar file in root folder and then i run command
"root@li226-128:~#sudo java -jar server.jar" and "root@li226-128:~#java -jar server.jar" but I got following error msg.
"Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
at java.awt.Window.<init>(Window.java:437)
at java.awt.Frame.<init>(Frame.java:419)
at javax.swing.JFrame.<init>(JFrame.java:218)
at Server.InfiniteChatServer.<init>(InfiniteChatServer.java:42)
at Server.InfiniteChatServer.main(InfiniteChatServer.java:283)"
Can you plz tell me where is problem.....???
Plz help me......
No X11 DISPLAY variable was set, but this program performed an operation which requires it
tells you that your application is looking for a variable that hasn't been set. Does your server have graphical environment installed?
Also spell out your words please, and don't double post (already reported by Nylex) since that will only pull attention away from your question.
No X11 DISPLAY variable was set, but this program performed an operation which requires it
tells you that your application is looking for a variable that hasn't been set. Does your server have graphical environment installed?
Also spell out your words please, and don't double post (already reported by Nylex) since that will only pull attention away from your question.
Kind regards,
Eric
Sorrry for double post.
Frd how I can check whether it is installed or not, if it is not installed then how I can install it???
Plz explain it properly....
Thanks in advance....
Obviously the JRE is installed, given you can run "java". The problem is that you need X running, as Eric pointed out. Please see the links given in posts 6 and 7.
You need the graphical environment to be installed (I guess you have done that but not sure which one) and running. If I'm not mistaken, you have to start your application from within the graphical environment as well, but not 100% sure.
As already pointed out by various LQ users, you need X installed. X is a graphical server on top of which a desktop environment and/or window manager can be installed so that you are not 'limited' to the console. Apparently your application needs X, or a part of it to function properly. So Wim Sturkenboom pointed you to an easy to follow step by step guide in post #7. Follow that guide to install X and try running your application again.
If an LQ user points you to a website you might want to take the time to read it since it could be of great help to you. If you don't understand what's explained in the website then tell us so and we'll try to clarify.
As already pointed out by various LQ users, you need X installed. X is a graphical server on top of which a desktop environment and/or window manager can be installed so that you are not 'limited' to the console. Apparently your application needs X, or a part of it to function properly. So Wim Sturkenboom pointed you to an easy to follow step by step guide in post #7. Follow that guide to install X and try running your application again.
If an LQ user points you to a website you might want to take the time to read it since it could be of great help to you. If you don't understand what's explained in the website then tell us so and we'll try to clarify.
1. Install Xmanager
2. Open Xmanager (passive)
3. run command on the server "export DISPLAY=you.r.ip.add:0.0:
4. java -jar jarfile.jar
Thanks for your support but can you please tell me where I found Xmanager setup and how to install it...
Please explain step by step so i do it properly.
Thanks in advance
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.