aspose file tools*
The moose likes Java in General and the fly likes confusion with output of java -version command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "confusion with output of java -version command" Watch "confusion with output of java -version command" New topic
Author

confusion with output of java -version command

Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
My system has Fedora 8 installed in it and I had previously installed jdk 6. Now I installed jdk 1.3 in another directory and set the PATH and JAVA_HOME variables to the following in the ~/.bashrc file

[root@localhost ]# echo $JAVA_HOME
/usr/local/jdk1.3.1_20
[root@localhost ]# echo $PATH
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/games:/usr/java/jdk1.3.1_20/bin:/usr/local/j2sdkee1.3.1/bin:/home/sugantha/bin:/root/bin

To my belief, nothing in my system points to the jdk 6 version, yet when I do


[root@localhost ]# java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)

Why does this happen...I need to get this right to properly start the J2EE RI server as it works only with JDK 1.3.Any help and pointers are much appreciated.Thanks in advance...


SCJP 5.0
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8968
    
    9

I'll bet you have a shortcut to java 6 in /usr/bin. Try "which java" and follow the links.


[How To Ask Questions On JavaRanch]
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Thanks Joe...I've changed the order of directories and now it correctly displays my Path.Many thanks again...
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Another problem has cropped up. I am trying to install the j2sdkee RI server.When it complained of an external dependency I installed libstdc++-libc6.1-1.so.2 ...Now when I start the server with

$j2ee -verbose
I get the following...

[root@localhost ~]# j2ee -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
eDB;create=true
Binding DataSource, name = jdbc/EstoreDB, url = jdbc:cloudscape:rmi:CloudscapeDB
;create=true
Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
DB;create=true
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
re.RemoteXaDataSource@142196
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
>
Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties >
Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3.1
LifecycleException: null.open: java.net.BindException: Address already in use
at org.apache.catalina.connector.http.HttpConnector.initialize(HttpConne ctor.java:1116)
at org.apache.catalina.startup.Embedded.start(Embedded.java:962)
at com.sun.web.server.WebService.start(WebService.java:217)
at com.sun.web.server.WebServer.start(WebServer.java:189)
at com.sun.enterprise.server.J2EEServer.startWebService(J2EEServer.java: 796)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:297)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
java.lang.RuntimeException: null.open
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:346)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
J2EE server reported the following error: null.open
Error executing J2EE server ...

Comparing this with the head first EJB text the bolded lines should have been

Starting web service at port: 9191
J2EE SDK/1.3.1
J2EE server startup complete

So I think my system is already using port 9191 and that is the problem...I am not sure though.Can you please suggest what should be done to make the server start normally...Thanks in advance.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8968
    
    9

The easiest thing to do would be to change the port the j2ee server is binding to. Consult your documentation.
You could also use netstat to figure out what's blocking the port and reconfigure it.
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
It does'nt look like there is an option to change the port where the application starts but when I run netstat nothing with that port number gets listed.But when I looked up in /etc/services I found these lines

sun-as-jpda9191/tcp# Sun AppSvr JPDA
sun-as-jpda9191/udp# Sun AppSvr JPDA

I tried locate, find for the process but could'nt find it anywhere.I tried googling for specific ways of closing ports but no help so far.What should I do to make this process terminate and thus close this port.Thanks for your help so far.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8968
    
    9

Originally posted by sugantha Jeevankumar:
It does'nt look like there is an option to change the port where the application starts but when I run netstat nothing with that port number gets listed.


The server has a configuration file where the ports are enumerated (a google search says the file is may be j2ee-ri-root/conf/server.xml).
Your configuration is using ports 7000 and 8000, not 9191 as the HFEJB book's example is configured, which may be part of your confusion.
/etc/services just lists suggested port bindings, not actual running services, so it is not much help.
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Thanks for the info...what do I do to avoid that error...The server.xml file is quite lengthy.Shall I post its contents?...The output specifically says LifecycleException and java.net.BindException. Also the head first book contains these three lines( 3 ports)

Starting web service at port:8000
Starting secure web service at port: 7000
Starting web service at port: 9191


Though I dont know what's the difference between the first and third lines. I am brand sparkling new to both linux and EJB, so having a hard time with this. Would be great if you could help me get around this

[ May 27, 2008: Message edited by: sugantha Jeevankumar ]
[ May 27, 2008: Message edited by: sugantha Jeevankumar ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8968
    
    9

Originally posted by sugantha Jeevankumar:

Starting web service at port:8000
Starting secure web service at port: 7000
Starting web service at port: 9191


If that's the case then you may well have something running on port 9191.
I can't help you with the server configuration. I've never used the J2EE RI.
You can always open the config file in a text editor and search for "9191". And consult your server documentation.
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Hurray...I could actually see the splash screen and the UI if the server finally. I noticed 7000 and 9191 listed under services, so changed them to 7001 and 9192 and the J2EE server startup was perfect.Then when I did

$deploytool
I got libXt.so.6: cannot open shared object file. So I downloaded and installed the dependency from rpm.pbone.net and the Application deployment tool opened fine. Thanks Joe for your valuable suggestions...I really appreciate it.Have a good day...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confusion with output of java -version command