How to install(use) NSG2(NS2 Scenarios Generator 2) in ubuntu 10.0.4
Hello All,
I want to use NSG2 in Ubuntu. But I'm unable to use it!! I already install java and download NSG2 from https://sites.google.com/site/pengjungwu/nsg!!! But I encounter the problem as follow! So, How to solve this problem? Please Help Me ,Sir!!! kmw@ubuntu:~$ java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.10.04.1) OpenJDK Client VM (build 20.0-b12, mixed mode, sharing) kmw@ubuntu:~$ java -jar NSG2.jar Exception in thread "main" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) at java.awt.Window.<init>(Window.java:477) at java.awt.Frame.<init>(Frame.java:419) at javax.swing.JFrame.<init>(JFrame.java:218) at nsg.NSG2.<init>(NSG2.java:51) at nsg.NSG2.main(NSG2.java:253) kmw@ubuntu:~$ |
Try running it in the headless mode....
Code:
-Djava.awt.headless=true |
dear EODSteven,
Thank You so much for your helping!!! But I don't know how to run it in the headless mode? Please guide me in detail,sir!!! Best regards, khinmyo |
How do you execute your program? I think we need to create a script file to add that variable into the java...let me know I have a simple script my grandson uses to play a game but I have to swith to linux to retreive it.
|
The answer was right in front of me....edit this command to go headless and it should fix it!
Code:
kmw@ubuntu:~$ java -jar NSG2.jar Code:
kmw@ubuntu:~$ java -Djava.awt.headless -jar NSG2.jar |
1 Attachment(s)
java -jar NSG2.1.jar
... Runs OK with sun-java6-jdk : Starts as a very tiny GUI. sudo apt-get install sun-java6-jdk . |
1 Attachment(s)
Gonna have to upgrade to 7, I tried to download this and got this....
|
# 7
Synaptic > Settings > Repositories : Other Software ... and then mark "non-free". Next : Refresh, and install 'sun-java6-jdk'. ( sudo apt-get update && sudo apt-get install sun-java6-jdk ). . |
Hello sir!
Thank you very much for your guide line! But, still now , I'm not ok to run NSG2. So,please help me ,sir! I will never forget your kindness! kmw@ubuntu:~$ java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.10.04.1) OpenJDK Client VM (build 20.0-b12, mixed mode, sharing) kmw@ubuntu:~$ java -jar NSG2.1.jar Exception in thread "main" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) at java.awt.Window.<init>(Window.java:477) at java.awt.Frame.<init>(Frame.java:419) at javax.swing.JFrame.<init>(JFrame.java:218) at nsg.NSG2.<init>(NSG2.java:57) at nsg.NSG2.main(NSG2.java:297) kmw@ubuntu:~$ java -Djava.awt.headless -jar NSG2.1.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649) at java.lang.Runtime.load0(Runtime.java:787) at java.lang.System.load(System.java:1022) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1667) at java.lang.Runtime.loadLibrary0(Runtime.java:840) at java.lang.System.loadLibrary(System.java:1047) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.loadLibraries(Toolkit.java:1614) at java.awt.Toolkit.<clinit>(Toolkit.java:1636) at java.awt.Component.<clinit>(Component.java:582) Could not find the main class: nsg.NSG2. Program will exit. kmw@ubuntu:~$ |
Sorry, the sun-java packages were removed from 10.04 ealier this year ..
http://www.bytespring.com/blog/sun-j...04-repostitory The easy way : Cheating an rpm package install .. 1) sudo apt-get install rpm 2) sudo rpm -Uvh --nodeps jdk-1.6.0_35-fcs.i586.rpm --force-debian http://ftp.scientificlinux.org/linux...5-fcs.i586.rpm 3) sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_33/bin/java 2 4) sudo update-alternatives --config java ... And then choose the "/usr/java/jdk1.6.0_35/bin/java" entry. Ubuntu 10.04 : java -jar NSG2.1.jar : Opens OK with "jdk1.6.0_35" NSG2.1 https://sites.google.com/site/pengjungwu/nsg EDIT : Both versions NSG2.jar, NSG2.1.jar work OK here with OpenJDK and the "sun jdk". . |
All times are GMT -5. The time now is 06:55 PM. |