开发者

Cannot Install JAVA EE in Ubuntu 11.04 after installing JDK

开发者 https://www.devze.com 2023-04-06 06:50 出处:网络
I am totally new to Ubuntu and Java altogether. I managed to install JDK 1.6 using the terminal. I am even able to run a simple HelloWorld. My problem is whenever I try to install the java_ee Im havin

I am totally new to Ubuntu and Java altogether. I managed to install JDK 1.6 using the terminal. I am even able to run a simple HelloWorld. My problem is whenever I try to install the java_ee Im having an error:

java.lang.UnsatisfiedLinkError: no Terminal in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at charva.awt.Toolkit.<clinit>(Toolkit.java:895)
    开发者_开发百科at charva.awt.Window.init(Window.java:62)
    at charva.awt.Window.<init>(Window.java:58)
    at charva.awt.Frame.<init>(Frame.java:32)
    at charvax.swing.JFrame.<init>(JFrame.java:34)
    at charvax.swing.JFrame.<init>(JFrame.java:30)
    at org.openinstaller.util.ui.ChaxStandaloneSplash.<init>(ChaxStandaloneSplash.java:91)
    at org.openinstaller.core.Orchestrator.main(Orchestrator.java:428)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.openinstaller.core.EngineBootstrap.main(EngineBootstrap.java:208)
SEVERE INTERNAL ERROR: no Terminal in java.library.path

Honestly I don't have enough idea about what I am doing. Please help me with this. Thanks in advance.


That stacktrace shows the error is happening on charva classes. charva requires a library called Terminal.

From charva's site:

For permanent installation, you just need to ensure that the directory containing 
the libTerminal.so library file is included in your library search path, which is
specified as follows:
· On Linux and Solaris it is specified by the environment variable LD_LIBRARY_PATH

So, find out if you have libTerminal.so, and if it is in fact specified by LD_LIBRARY_PATH.

Just to add, here is the source code that's making this fail.

    static {
        // ...
        System.loadLibrary("Terminal");
        Toolkit.init();     // call native function to initalize ncurses.
    }

It might also help to take a look at this related question: Exception in thread “main” java.lang.UnsatisfiedLinkError: no Terminal in java.library.path

UPDATE If you don't have libTerminal.so, take a look at charva's site, and follow charva's installation instructions. There's a step in which you build libTerminal.so.


Looks like Java needs a native library called Terminal to run. This looks like a wrong library path.

If you get a runtime error "java.lang.UnsatisfiedLinkError: no xxx in java.library.path", which means that JRE cannot find your native library at runtime. The easier way to debug is to print out the contents of "java.library.path" via System.out.println(System.getProperty("java.library.path")). You could set the native library path via the command-line VM option -Djava.library.path=xxx.


I just ran into this same problem. Issue seems to be that Glassfish installer is not finding the correct JAVA_HOME location. You can set this manually in the installer with a -j flag (the installer script passes this to the glassfish installer).

Running the following allowed the glassfish installer to run successfully for me. You can run 'which java' to get an idea for where java is installed on your machine.

sh ./java_ee_sdk-6u3-jdk7-linux-x64.sh -j [java install directory]

(where [java install directory] is the path to your java install).


You ran it in tty or a virtual terminal under X-window? Why you need to "install" java EE? Usually the jar file is enough for development.


The excetion is raised because the default JVM isn't SUN or ORACLE, maybe OPENJDK, Jrockit, etc. For check this, execute echo $JAVA_HOME or java -version and check if the jvm set as default is from ORACLE or SUN. If not, execute: sudo update-alternatives --config java and select the correct one. If you haven't a SUN or ORACLE JRE installed, first install one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号