Java on Linux - A simple question

My system is Red Hat Linux 8.0 running the GNOME2 desktop.
I have Sun Java2 sdk 4.1 for linux. I am using JEdit to write my programs.
I have two locations in this question.
firstly /home/Chris/javafiles (contains my own written java files)
and
secondly /usr/java/j2sdk1.4.0_01/bin (contains javac and java etc)
After I wrote a java program called hello.java I opened the terminal and typed the following command
[Chris@localhost Chris]$ cd javafiles
[Chris@localhost javafiles]$ /usr/java/j2sdk1.4.0_01/bin/javac hello.java
this gave me
[Chris@localhost javafiles]$
and compiled my hello.java program to create Hello.class
so then still in the javafiles directory I ran
[Chris@localhost javafiles]$ /usr/java/j2sdk1.4.0_01/bin/java Hello
and got
[Chris@localhost javafiles]$
so whats going on?
why didn't it run my program?
The content of my program is
class Hello
     public static void main(String[] args)
          System.out.print("Hello World");
Can anyone Help?
Thankyou
Chris

Chcek for consistent capitalization of the class name and file name - appears incorrect.

Similar Messages

  • OMG! These web pages are java classes! :) A simple question!

    I imported a web page fragment as "header". Now I'm trying to display the header before "page1".
    I tried putting this into the page1.java, but no luck.
    public HtmlForm getHeader() {
    doug2005.header hd = new doug2205.header();
    return hd.getForm1();
    This has to be simple to do. How should I do the method?
    Thanks!

    Thanks! That worked very well. I think I'm getting the idea here. I'm working with something called "JSP" pages which is there own language like "ASP" pages.
    You don't happen to know the current links to these directives and such. My searches tend to bring up outdated material.
    Thanks much!

  • Simple question about JAVA path

    Hi. I have a simple question , but I spent several hours trying to find an answer.
    How do I know the location of the java executable which is used by Concurrent Manager.
    I already know that running which java under application user will not give me the correct answer

    Maybe you can try like this:
         public String getPath(){
              Class cls=getClass();
              String className=cls.getName();
              String packageName=cls.getPackage().getName();
              System.out.println(className);
              System.out.println(packageName);
              String newClassName=className.replaceAll("\\.", "/");
              String resouceName=newClassName+".class";
              System.out.println(resouceName);
              URL url;
              url=cls.getClassLoader().getResource(resouceName);
              String path="";
              path=url.getFile();
              return path;
         }

  • Simple Question Calling methods from Java files through JSP without JVM

    Hi.
    I've got a simple question (forigve my newbieness)...
    If I'm running Tomcat can I exectue a method in a compiled Java file from a JSP page without having the JVM installed on the server?
    Any thoughts or additional comments would be appreciated.
    Many thanks.

    No... but that's because you can't run Tomcat without
    a JVM installed on the server.
    If you are running Tomcat, you are running a JVM for
    the JSP pages to run in, in which case, yes, the JSP
    pages can call the other Java code... as long as it's
    in the classpath.Thanks a lot for the replies.
    So just to check, if I sign up with a hosting company that offers Tomcat then the JVM will be installed on the server and I can call other Java code as long as it's in the classpath?
    I just want to make sure before I sign up with a hosting company =D
    Thanks again!

  • Just simple question about java HTTP session mechanism...

    I have one simple question regarding the java HTTP Session Mechanism.
    1) Is there another alternative for the HTTP Session ? If have, what the alternative?
    2) I have been acknowledge that HTTP session is same as cookie system and others say have many different, where is the different..
    thanks

    1) You can always do your own session handling. But why bother when there is one there for you?
    2) The issue with sessions is how to identify the user from the request. Each session gets given a session id. The user has to send that session id with every request they make.
    The standard way is to use a session cookie, which only lasts as long as the browser session. The cookie with the JSESSIONID is sent with every request, thus the server can identify which session a user is in from their cookie.
    Of course you cannot assume that the browser will support cookies, so you need to encode all URLs with the method response.encodeURL(). That method puts the session id into the URL if the browser does not support cookies, or they have them switched off.

  • Simple question about flex and AS 3.0

    Hi, this might sound like a simple question so I apologize...
    I have both a copy of flex 2 and 3, and i want to simply code in AS
    3.0 not mxml. I referred to the help of both flex 2 and 3, and all
    i could come up with is "you can add dynamic behavior to your
    documents using actionscript", which means to me, you only write
    your functions in AS and create instances with mxml (...ugh).
    personally, i find mxml to be ugly (mainly because it looks like
    html to me), and i'd rather not use it. coming from programming in
    an IDE in Java, it seems like it would be nicer to have something
    similar, all the while having the power and cool features of flash.
    I'm not fully educated in this matter so i understand that i could
    be totally wrong.
    i mean, if i have to code in mxml, i will. i'm a web
    programmer for a living, and if a more experience programmer said
    something like "if you don't code mxml in flex, you'll never get a
    job coding in flex", i would trust the advice, and learn the ugly
    code. :)
    yes, i do have Flash cs3, it's great but it seems like a pain
    to me the way you organize classes.... i've only seen a few
    tutorials, ones that explain how you cannot simply import a custom
    class, you have tell your movie to link to it, put it in the same
    directory, or manually name the package, it's sort of confusing.
    my main point here is that i'm very eager to start building
    apps in straight AS 3.0 instead of using flash cs3 (for some
    projects), and it would be cool to get some help or be pointed in
    the right direction.
    to simplify:
    can i write AS 3.0 and only as 3.0 in flex 2 or 3? how? can
    you link me to a tutorial? any advise?
    thanks!

    Hey William, thanks for the post. It's a great coincidence
    because I'm reading that book as well. I'm about half way through
    it, and I love it. I installed mxmlc on my linux box and am writing
    pure AS 3 apps. I think that's the way to go, though I know it's
    not for everybody.
    My problem with mxml is that it has a weird syntax for
    function calls, and it's not as 'intuitive' for a person like me,
    who came from C++ and Java programming in the past. I like writing
    programs in the C++ and Java style syntax, and since so many other
    languages use a similar syntax, I don't see any reason to learn the
    nuances of mxml, unless I was getting paid to do it. As far as I
    can tell there is no benefit.
    I hate using Flash to write flash apps as well, I feel like
    they become messy and confusing, especially when trying to write an
    OOP application. I only use it if I want to move an object in a
    very specific way and can't do it with the Tween methods.

  • Javac : command not found ?? A simple question.

    Hello.
    I need to somehow tell linux where to find javac so that I don't need
    to type in /usr/local/jdk1.4/javac HelloWorldApp.java every time I need
    to run javac. I have seen how to do this in windows but I don't know how to do it in Linux
    I know it's a simple question, I'm just new to Linux.
    Your help is appreciated.

    The answer depends on the shell you use.
    The default on linux is bash, so do this: In your home directory there is a file with the name .bashrc. Commands in that file are performed every time you start the shell.
    In that file, add the command "export PATH=/usr/local/jdk1.4/bin:$PATH". Then "source .bashrc" so that the change takes effect. You can verify that the directory has been added with "echo $PATH".
    If you want to set the path for all users and not just yourself, make the change in the system startup files. This depends on your distro; the right file might be /etc/profile or /etc/profile.local or /etc/bashrc.

  • Load Balancing Directory Servers with Access Manager - Simple questions

    Hi.
    We are in the process of configuring 2 Access Manager instances (servers) accessing the same logical LDAP repository (comprising physically of two Directory Servers working together with Multi-Master Replication configured and tested) For doing this, we are following guide number 819-6258.
    The guide uses BigIP load balancer for load balancing the directory servers. However, we intend to use Directory Proxy Server. Since we faced some (unresolved) issues last time that we used DPS, there are some simple questions that I would be very grateful to have answers to:
    1. The guide, in section 3.2.10 (To configure Access Manager 1 with the Directory Server load balancer), talks about making changes at 4 places, and replacing the existing entry (hostname and port) with the load balancer's hostname and port (assuming that the load balancer has already been configured). It says that changes need not be made on Access Manager 2 since the LDAPs are in replication, and hence changes will be replicated at all places. However, the guide also states that changes have to be made in two files, namely AMConfig.properties, and the serverconfig.xml file. But these changes will not be reflected on Access Manager 2, since these files are local on each machine.
    Question 1. Do changes have to be made in AMConfig.properties and serverconfig.xml files on the other machine hosting Access Manager 2?
    Question 2: What is the purpose of putting these values here? Specifically, what is achieved by specifying the Directory server host and port in AMConfig.properties, as well as in serverconfig.xml?
    Question 3. In the HTTP console, there is the option of specifying multiple primary LDAP servers, as well as multiple secondary LDAP servers. What is the purpose of these? Are secondary servers attempted when none of the list in the primary list are accessible? Also, if there are multiple entries in the primary server list, are they accessed in a round robin fashion (hereby providing rudimentary load balancing), or are other servers accessed only when the one mentioned first is not reachable etc.?
    2. Since I do not have a load balancer setup yet, I tried the following deviation to the above, which, according to me, should have worked. If viewed in the HTTP console, LDAP / Membership / MSISDN and Policy configuration all pointed to the DS on host 1. When I changed all these to point to the directory server on host 2 (and made AMConfig.properties and serverconfig.xml on host 1 point to DS of host 2 as well), things should have worked fine, but apparently Access manager 1 could not be started. Error from Webserver:
    [14/Aug/2006:04:30:36] info (13937): WEB0100: Loading web module in virtual server [https-machine_1_FQDN] at [search]
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: Exception in thread "EventService" java.lang.ExceptionInInitializerError
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: at com.iplanet.services.ldap.event.EventServicePolling.run(EventServicePolling.java:132)
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: at java.lang.Thread.run(Thread.java:595)
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: Caused by: java.lang.InterruptedException
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: at com.sun.identity.sm.ServiceManager.<clinit>(ServiceManager.java:74)
    [14/Aug/2006:04:31:48] warning (13937): CORE3283: stderr: ... 2 more
    In effect, AM on 1 did not start. On rolling back the changes, things again worked like previously.
    Will be really grateful for any help / insight / experience on dealing with the above.
    Thanks!

    Update to the above, incase anyone is reading:
    We setup a similar setup in Windows, and it worked. Here is a detailed account of what was done:
    1. Host 1: Start installer, install automatically, chose Directory server, Directory Administration server, Directory Proxy server, Web server, Access Manager.
    All installed, and worked fine. (AMConfig.properties, serverconfig.xml, and the info in LDAP service, all pointed to HOST1:389)
    2. Host 2: Start installer, install automatically, chose Directory server, Directory Administration server, Directory Proxy server, Web server, Access Manager.
    All installed, and worked fine. (AMConfig.properties, serverconfig.xml, and the info in LDAP service, all pointed to HOST2:389)
    3. Host 1: Started replication. Set to Master
    4. Host 2: Started replication. Set to Master
    5. Host 1: Setup replication agreement to Host 2
    6. Host 2: Setup replication agreement to Host 1
    7. Initiated the remote replica from Host 1 ----> Host 2
    Note that since default installation uses abc.....xyz as the encryption key, setting this to same was not an issue.
    9. Started webserver for Host 1 and logged into AM as amadmin.
    10. Added Host 2 FQDN in DNS Aliases / Realms
    11. Added http://HOST2_FQDN:80 in the Platform server (instance) list.
    12. Started Host 2 webserver. Logged in AM on Host 2, things worked fine.
    At this stage, note the following:
    a) Host 1:
    AMConfig.properties file has
    com.iplanet.am.directory.host=host1_FQDN
    and
    com.iplanet.am.directory.port=389
    serverconfig.xml has:
    <Server name="Server1" host="host1_FQDN" port="389" type="SIMPLE" />
    b) Host 2:
    AMConfig.properties file has
    com.iplanet.am.directory.host=host2_FQDN
    and
    com.iplanet.am.directory.port=389
    serverconfig.xml has:
    <Server name="Server1" host="host2_FQDN" port="389" type="SIMPLE" />
    c) If one logs into AM, and checks LDAP servers for LDAP / Policy Configuration / Membership etc services, they all contain Host2_FQDN:389 (which makes sense, since replica 2 was initialized from 1)
    Returning back to the configuations:
    13. On Host 1, login into the Admin server console of the Directory server. Navigate to the DPS, and confgure the following:
    a) Network Group
    b) LDAP servers
    c) Load Balancing
    d) Change Group
    e) Action on-bind
    f) Allow all actions (permit modification / deletion etc.).
    g) any other configuations required - Am willing to give detailed steps if someone needs them to help me / themselves! :)
    So now, we have DPS configured and running on Host1:489, and distributing load to DS1 and DS2 on a 50:50 basis.
    14. Now, log into AM on Host 1, and instead of Host1_fqdn:389 (for DS) in the following places, specify Host1_fqdn:489 (for the DPS)--
    LDAP Authentication
    MSISDN server
    Membership Service
    Policy configuation.
    Verified that this propagated to the Policy Configuration service and the LDAP authentication service that are already registered with the default organization.
    15. Log out of AM. Following the documentation, modify directory.host and directory.port in AMConfig.properties to point to Host 1_FQDN and 489 respectively. Make this change in AMConfig.properties of both Host 1 as well as 2.
    16. Edit serverconfig.xml on both hosts, and instead of they pointing to their local directory servers, point both to host1_FQDN:489
    17. When you start the webserver, it will refuse to start. Will spew errors such as:
    [https-host1_FQDN]: Sun ONE Web Server 6.1SP5 B06/23/2005 17:36
    [https-host1_FQDN]: info: CORE3016: daemon is running as super-user
    [https-host1_FQDN]: info: CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0_04] from [Sun Microsystems Inc.]
    [https-host1_FQDN]: info: WEB0100: Loading web module in virtual server [https-host1_FQDN] at [amserver]
    [https-host1_FQDN]: warning: WEB6100: locale-charset-info is deprecated, please use parameter-encoding
    [https-host1_FQDN]: info: WEB0100: Loading web module in virtual server [https-host1_FQDN] at [ampassword]
    [https-host1_FQDN]: warning: WEB6100: locale-charset-info is deprecated, please use parameter-encoding
    [https-host1_FQDN]: info: WEB0100: Loading web module in virtual server [https-host1_FQDN] at [amcommon]
    [https-host1_FQDN]: info: WEB0100: Loading web module in virtual server [https-host1_FQDN] at [amconsole]
    [https-host1_FQDN]: warning: WEB6100: locale-charset-info is deprecated, please use parameter-encoding
    [https-host1_FQDN]: info: WEB0100: Loading web module in virtual server [https-host1_FQDN] at [search]
    [https-host1_FQDN]: warning: CORE3283: stderr: netscape.ldap.LDAPException: error result (32); matchedDN = dc=sun,dc=com; No such object (DN changed)
    [https-host1_FQDN]: warning: CORE3283: stderr: Got LDAPServiceException code=-1
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.services.ldap.DSConfigMgr.getConnection(DSConfigMgr.java:357)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.services.ldap.DSConfigMgr.getNewFailoverConnection(DSConfigMgr.java:314)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.services.ldap.DSConfigMgr.getNewConnection(DSConfigMgr.java:253)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.services.ldap.DSConfigMgr.getNewProxyConnection(DSConfigMgr.java:184)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.services.ldap.DSConfigMgr.getNewProxyConnection(DSConfigMgr.java:194)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ums.DataLayer.initLdapPool(DataLayer.java:1248)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ums.DataLayer.(DataLayer.java:190)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ums.DataLayer.getInstance(DataLayer.java:215)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ums.DataLayer.getInstance(DataLayer.java:246)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.sun.identity.sm.ldap.SMSLdapObject.initialize(SMSLdapObject.java:156)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.sun.identity.sm.ldap.SMSLdapObject.(SMSLdapObject.java:124)
    [https-host1_FQDN]: warning: CORE3283: stderr: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [https-host1_FQDN]: warning: CORE3283: stderr: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    [https-host1_FQDN]: warning: CORE3283: stderr: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    [https-host1_FQDN]: warning: CORE3283: stderr: at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    [https-host1_FQDN]: warning: CORE3283: stderr: at java.lang.Class.newInstance0(Class.java:350)
    [https-host1_FQDN]: warning: CORE3283: stderr: at java.lang.Class.newInstance(Class.java:303)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.sun.identity.sm.SMSEntry.(SMSEntry.java:216)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.sun.identity.sm.ServiceSchemaManager.(ServiceSchemaManager.java:67)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.am.util.AMClientDetector.getServiceSchemaManager(AMClientDetector.java:219)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.am.util.AMClientDetector.(AMClientDetector.java:94)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.sun.mobile.filter.AMLController.init(AMLController.java:85)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:322)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:120)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3271)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.StandardContext.start(StandardContext.java:3747)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
    [https-host1_FQDN]: warning: CORE3283: stderr: at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
    [https-host1_FQDN]: warning: CORE3283: stderr: at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    [https-host1_FQDN]: failure: WebModule[amserver]: WEB2783: Servlet /amserver threw load() exception
    [https-host1_FQDN]: javax.servlet.ServletException: WEB2778: Servlet.init() for servlet LoginLogoutMapping threw exception
    [https-host1_FQDN]: at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:949)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3478)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardContext.start(StandardContext.java:3760)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
    [https-host1_FQDN]: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
    [https-host1_FQDN]: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
    [https-host1_FQDN]: at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
    [https-host1_FQDN]: at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    [https-host1_FQDN]: ----- Root Cause -----
    [https-host1_FQDN]: java.lang.NullPointerException
    [https-host1_FQDN]: at com.sun.identity.authentication.UI.LoginLogoutMapping.init(LoginLogoutMapping.java:71)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:921)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3478)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardContext.start(StandardContext.java:3760)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
    [https-host1_FQDN]: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
    [https-host1_FQDN]: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    [https-host1_FQDN]: at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
    [https-host1_FQDN]: at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
    [https-host1_FQDN]: at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
    [https-host1_FQDN]: at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)
    [https-host1_FQDN]:
    [https-host1_FQDN]: info: HTTP3072: [LS ls1] http://host1_FQDN:58080 [i]ready to accept requests
    [https-host1_FQDN]: startup: server started successfully
    Success!
    The server https-host1_FQDN has started up.
    The server infact, didn't start up (nothing even listening on 58080).
    However, if AMConfig.properties is left as it originally was, and only serverconfig.xml files were changed as mentioned above, web servers started fine, and things worked all okay. (Alright, except for some glitches when viewed in /amconsole. If /amserver/console is accessed, all is good. Can this mean that all is still not well? I am not sure).
    So far so good. Now comes the sad part. When the same is done on Solaris 9, things dont work. You continue to get the above error, OR the following error, and the web server will refuse to start:
    Differences in Solaris and Windows are as follows:
    1. Windows hosts have 1 IP and hostname. Solaris hosts have 3 IPs and hostnames (for DS, DPS, and webserver).
    No other difference from an architectural perspective.
    Any help / insight on why the above is not working (and why the hell does the documentation seem so sketchy / insecure / incorrect).
    Thanks a bunch!

  • A very very very simple question

    Hi guys,
    I have a very simple question and standard but I cant find anywhere...
    I have two dateTime variables, i need to calculate difference between this dates in days, thats it.
    I tried all functions and tried without success a Java Embed task but I couldnt retrieve this objects as java.util.Date so I couldnt calculate exactly the difference in days like this pure java code:
    (dataVencimento.getTime() - dataReferencia.getTime()) / 86400000L)
    can you help me this?

    Hi Jose
    Just see if these alternate approaches works. I know there may be lot like this and you may be lucky to find out simple out of box solution itself. If you want to solve this issue and move ahead, gives these approaches a shot.
    1. Create a very simple standalone WebService that takes 2 input date elements (can be of Date type or String type. If string type, convert to date in your java code). Create a simple operation like getDaysBetween(firstDate, secondDate). In the generated webservice impl class, use the java code apis (refer earlier link for usage), and get the difference. Return this value. NOW, invoke this WebService in your BPEL Process, and pass your 2 inputs (if the bpel payload elemetns are date object or string objects of date), and get output, and then use this output in your continuing bpel process.
    2. This approach, I did a long back. When we insert any expression using XPath, in that editor window on bottom right side, we see many categories and for each category we see list of functions we can use, like for String, we can use concat etc. I vaguely remember reading somewhere, that we can add our own custom functions also in this section. So explore this direction and see if you can add your own function and then use that fucntion with your 2 input dates.
    I have not given solution to your problem, but may be these directions can help you move ahead. Or something along these lines.
    Thanks
    Ravi Jegga

  • This is a very simple question,but I don't know.Please me.Thank you!

    I am a Chinese student in a university.I have a very simple question to ask.
    I have writed a EJB module,and I have deployed to Weblogic8.1 successfully.
    1.Now I want to write a client program.Is it necessary that the client program is packaged in the EJB package.For example ,the EJB package is Beans,is "package Beans " or "import Beans.*" necessary in my client program.
    2.If I only know the EJB interfaces,that means the EJB module is writed by other programer.I want to know how I can write the client program.How can I call EJB module's method writed by other programer.Could you give me a simple example?
    Thank you very much.

    I have writed a EJB module,and I have deployed to
    Weblogic8.1 successfully.:-)
    1.Now I want to write a client program.Is it
    necessary that the client program is packaged in the
    EJB package.For example ,the EJB package is Beans,is
    "package Beans " or "import Beans.*" necessary in my
    client program.You need not package your client with the EJB. It can be a JSP/servlet or a stand-alone application.
    2.If I only know the EJB interfaces,that means the
    EJB module is writed by other programer.I want to
    know how I can write the client program.How can I
    call EJB module's method writed by other
    programer.Could you give me a simple example?
    import java.util.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import examples.*;
    class TestEJBHello {
        public static void main(String[] args) {
            Context context   = null;
            Object object     = null;
            // Hashtable for environment properties.
            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            env.put(Context.PROVIDER_URL, "t3://localhost:7001");
            HelloHome home            = null;
            HelloWorld hello          = null;
            try {
                context     = new InitialContext(env);
                object      = context.lookup("HelloWorldTest");
                System.out.println(" JNDI Looked up >>> " +object);
                home        = (HelloHome)PortableRemoteObject.narrow(object, HelloHome.class);
                hello       = home.create();
                System.out.println(hello.hello());
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                close(context);        // Closes the initial context.
        private static void close(Context context) {
            try {
                context.close();
                System.out.println("*** Context closed. ***");
            } catch (NamingException namingException) {
                namingException.printStackTrace();
            } catch(Exception exception) {
                exception.printStackTrace();
    }Here's a sample client app code I use for a HelloWorld EJB. You need to have a EJB client JAR containing the home and remote interfaces in the classpath during compile time and runtime.
    x

  • Simple Question - How do I deploy custom taglibs to Oracle 9iAS r2?

    Simple question.
    There are lots of simple examples on JSP custom tags that have
    a .tld file, a .java file with the handler class, and a .jsp
    file that calls the custom tag to test it.
    My question is, lets say I have a .tld file, a .java file and
    a .jsp file for a tag example. How do I deploy them to
    Oracle 9iAS r2? I'd like to code an example and deploy it,
    but I'm stuck. I'm using Jdeveloper 9i, and have compiled the
    .java file and included it and the .tld in a Custom Taglib JAR.
    How is this JAR deployed to Oracle 9iAS, considering that the
    Enterprise Manager only deploys WAR and EAR files? How do
    a configure a web app to use the custom tags...
    This should be simple -- maybe its too simple so I'm stuck!

    check out ojspdemos which comes with the product.
    Also see
    http://otn.oracle.com/tech/java/oc4j/doc_library/902/jsp/taglibs.htm#1004903
    -Prasad

  • Generate a thumbnail from HTML by pure Java on Linux without Graphics

    hi - we in a requirement where we have to generate thumbnails from HTML code. The solution must be implemented in pure Java on Linux where there is no graphics support.
    Options tried already are :--
    1. 3rd party websites - rolled out by our client.
    2. Paid products - rolled out by our client
    3. Media Tracker and other java API - no luck as there is no support after HTML 4.0
    4. Using any os dependent native library - rolled out by our client.
    5. Lobo browser - but having troubles like it opens the browser before screenshot is taken, sometimes. Gone through by putting Thread.sleep() in between and saving remote images into a local html file etc. We got some success in there but problem doesn't end here.
    Questions -
    1. In the point # 5 above, our Linux server had graphics support but in code we set the system property java.awt.headless= true before capturing and generating thumbnail. My question is, if we set this property in the code then does it mean 100% that our code will not use any graphics support, if present in the underlying OS?
    2. Is this really possible to generate images in java on Linux where there is no X window/X server installed? Are we just wasting time in order to achieve which is unachievable?
    Any suggestions are most welcome.
    Regards,
    Sanjeev

    Thanks for ur response! Yeah - we tried but requirements are little different. We have HTML that we have to first render. Whatever output comes, we have to take a screenshot. So in order to render the html we have to have a browser first and I believe every OS which is providing browser support is having Graphics capabilities because browser would have frames, windows, toolbars, menubars etc which fall under Graphics.
    The above way is the only way that I know. If there are another way which ofcourse doesn't require graphics support, please let me know.
    So the question basically is - if I follow above mentioned image (like opening browser and capture screenshot) then is it possible on Linux with no graphics support? Actually I read on internet that lobo browser (written in java) supports this kind of feature.

  • WD Abap - simple question (required field)

    hi folks,
    quite a simple question i guess.
    i have a field marked as required (gets a red asteriks). In the actions i have "Standard" so they should have to do all the validations, but i still can execute the action, i did not find a docu for the behaviour of the "required" features? i thought like in r/3 sapgui appl. a default error messages will be shown?
    any ideas?
    kind regards,
    oliver

    Oliver,
    I guess there is no difference between WD ABAP and WD Java in this regard, so I will answer from WD Java developer point:
    "Required" actually means visual hint to user that input is mandatory. What "mandatory" actually means is application-specific.
    For example, in Java string could be either null, or empty, or contains only spaces, or rest. What is mandatory here? Not null? Not empty? Something besides spaces? Ok, even worth, let us assume that we are entering some number (material, order). So string with only zeroes is also "empty".
    Hence WD does not handle "required" flag itself, this is left for application developer.
    Certainly, some data type constraints like minimal text length, or minimal numeric value may be treated as "required", and here WD works well.
    VS

  • Set Date Time Computer with Java in Linux OS

    Dear All,
    How to set date time computer with Java in linux OS?
    Rgds,
    Theo

    There is no API for this you'd have to run an external command using Process.exec.
    This is the wrong forum for general Java "how to" questions.

  • Help with simple question.......

    This is a simple question but i can't seem to figure it out.
    For example i am using this code...
    feel free to run this code...
    When you run this you see the scrollbars with the Swing look (Bars look so nice)...
    I am using this same type of code in my other project with JBuilder 7 and I am getting the plain look of the scrollbars.
    Any suggestions will be greatly appreciated..
    =======================================================
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.*;
    import java.awt.event.*;
    public class SimpleTableDemo extends JFrame {
    private boolean DEBUG = true;
    public SimpleTableDemo() {
    super("SimpleTableDemo");
    Object[][] data = {
    {"Mary", "Campione",
    "Snowboarding", new Integer(5), new Boolean(false)},
    {"Alison", "Huml",
    "Rowing", new Integer(3), new Boolean(true)},
    {"Kathy", "Walrath",
    "Chasing toddlers", new Integer(2), new Boolean(false)},
    {"Mark", "Andrews",
    "Speed reading", new Integer(20), new Boolean(true)},
    {"Angela", "Lih",
    "Teaching high school", new Integer(4), new Boolean(false)}
    String[] columnNames = {"First Name",
    "Last Name",
    "Sport",
    "# of Years",
    "Vegetarian"};
    final JTable table = new JTable(data, columnNames);
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    if (DEBUG) {
    table.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    printDebugData(table);
    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);
    //Add the scroll pane to this window.
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    private void printDebugData(JTable table) {
    int numRows = table.getRowCount();
    int numCols = table.getColumnCount();
    javax.swing.table.TableModel model = table.getModel();
    System.out.println("Value of data: ");
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + model.getValueAt(i, j));
    System.out.println();
    System.out.println("--------------------------");
    public static void main(String[] args) {
    SimpleTableDemo frame = new SimpleTableDemo();
    frame.pack();
    frame.setVisible(true);

    any help will get DUKE $$$$$$$$$$$$$$$$

Maybe you are looking for