How to execute .jar files in ubuntu linux server
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. |
Quote:
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...... |
Hello,
This messages: Code:
No X11 DISPLAY variable was set, but this program performed an operation which requires it 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 |
Quote:
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.... |
It's probably a good idea for you to read the documentation for your distribution.
Also, if you have to run graphical programs on a remote machine, it might be worth you looking into NX (see, e.g. this). |
A bit of googling can get you a long way. But I understand that one has to know what to search for.
ubuntu server install gui First hits: Install GUI in Ubuntu Server and How to install GUI in Ubuntu 10.04 (Lucid Lynx) Server. |
Frds I checked it. Jre is installed in linux server already.
Now what I should do?? Any other idea???? Plzzzz help |
Again, please spell out your words.
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. |
what is X Running???
Please explain it and I also tried these links but no results..... Sorry friends but any other solution??/ |
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.
Search how to start X; this might depend on the version of Ubuntu (not sure). A link I found: http://nixcraft.com/linux-software/4...ntu-linux.html And read the documentation. |
Hello,
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. Kind regards, Eric |
Quote:
links tells I installed GNOME desktop. Now what I have to do guide me please...... |
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 |
Quote:
Please explain step by step so i do it properly. Thanks in advance |
All times are GMT -5. The time now is 09:27 PM. |