How to set the defualt directory of where to look for a file to read

I am reading a file from a servlet. I wanted to see where Tomcat would write the file if I didn't specify a path. The results surprised me. It wrote the file in: "C:\Documents and Settings\myusername\Start Menu\Programs\Apache Tomcat 4.1". So I looked through server.xml to see if perhaps this path was set there but didn't find anything. I right clicked on the "Start Tomcat" target to see its properties and there it was. There was a field "Start in:" and it contained the aforementioned path. I changed it to what I wanted but there has to be a way to set this in server.xml. How do I do this. my guess would be something like :
"<Context path="" docBase="c:/theDefaultDirectory" debug="0"/>", but this didn't work. Any light on this subject would GREATLY be appreciatted,
silas

Well, actually, it opens file where the process is currently located on your fileSystem. since you seems to be using windows, the process is started in the directory written in the "Starts In" field. Now you could use the command line (the ugly MSDOS like window), go to some directory and starts the tomcat process from there, and the files would be created in that place.
The docBase tells where tomcat should look when looking for pages (html jsp, etc...). If you want to use it, you can still refers to it as :
new File (yourServlet.getServletConfig().getContextPath("/myfile.txt"))Another track to check would be to look in the System.getProperties. There has to be some property that gives the current JVM path, try to change it to the location you'd like it to be and see if it conforms to how you'd like to see it works.
Still, remember that you can have multiple Context in your servlet container, so there's no reason for tomcat to set the JVM default path to the docBase from one or another (File is a global JVM utility, not a J2EE only feature !!).

Similar Messages

  • How to set the target directory from source filename using adaptor module.

    Hi,
    How im using a logical bypass scenario.I have to set the target directory using the sorce filename.There is no chance of using a Java UDF as my scenario does not have a Mapping(as it is a Bypass Scenario).The only option that i got is to use a Adaptor module.Can anyone help  me this.
    Thanks,
    Bhargav

    Hi,
    See this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/61e1407e858031e10000000a1550b0/content.htm
    hope it helps.
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • How to set the working directory for reports in linux

    Hi All,
    Can you anyone help me to set the working directory for oracle application server 10g reports? I am using RHEL4 and AS10g. Actually i want to run my reports from my define
    working directory. How can I do this?
    Thanks in advance
    Arif

    Hi,
    your rep_srv.conf should look like something like
    +<?xml version = '1.0' encoding = 'ISO-8859-1'?>+
    +<!DOCTYPE server PUBLIC "-//Oracle Corp.//DTD Reports Server Configuration //EN" "file:D:\oracle\FRHome_1/reports/dtd/rwserverconf.dtd">+
    +<server version="10.1.2.0.2">+
    +<!--Please do not change the id for reports engine.-->+
    +<!--The class specifies below is subclass of _EngineClassImplBase and implements EngineInterface.-->+
    +<cache class="oracle.reports.cache.RWCache">+
    +<property name="cacheSize" value="50"/>+
    +<!--property name="cacheDir" value="your cache directory"-->+
    +<!--property name="maxCacheFileNumber" value="max number of cache files"-->+
    +<!--property name="ignoreParameters" value="parameter names to be ignored in constructing cache key, separated by comma ','"-->+
    +</cache>+
    +<engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1" maxEngine="3" minEngine="0" engLife="50" maxIdle="30" callbackTimeOut="90000" jvmOptions="-Xmx512M -Xss512K">+
    +<!--property name="sourceDir" value="your reports source directory"/-->+
    +<!--property name="tempDir" value="your reports temp directory"/-->+
    +<!--property name="keepConnection" value="yes"/-->+
    +</engine>+
    +...+
    some more definitions
    +..+
    +<!--pluginParam name="proxy" type="file">proxyinfo.xml</pluginParam-->+
    +<pluginParam name="xmlpds" type="file">xmlpds.conf</pluginParam>+
    +<pluginParam name="jdbcpds" type="file">jdbcpds.conf</pluginParam>+
    +<pluginParam name="textpds" type="file">textpds.conf</pluginParam>+
    *<environment id="APP1">*
    *+<envVariable name="REPORTS_PATH" value="/application1/reports"/>+*
    *+</environment>+*
    *+<environment id="APP2">+*
    *+<envVariable name="REPORTS_PATH" value="/application2/reports"/>+*
    +</environment>+
    +</server>+
    The environment ids you can choose yourself and you have to put them in there yourself too (here I put two environments for two different applications "1" and "2").
    If you call a report from Forms, then you have to code something like
    ADD_PARAMETER(p_list,'ENVID',TEXT_PARAMETER,'APP1');
    Details depend on how you call your reports, my example is for using a parameter list and calling a report out of application1
    Hope that helps.
    Volker

  • How to set the initial directory

    Using the FileChooser in JavaFX 2.0. How do you correctly set the initial directory?
    In Swing you would do the following:
    JFileChooser Choose = new JFileChooser();
    Choose.setCurrentDirectory(new File("."));But in JavaFX:
    Choose.setInitialDirectory(new File("."));does not work and causes JavaFX to bomb out when this code is triggered.
    Edited by: 863626 on 30-Oct-2011 05:30

    javafx.stage.FileChooser choose = newjavafx.stage.FileChooser();
    File d = new File(getClass().getResource(".").getFile());
    choose.setInitialDirectory(d);

  • How to set the deployment directory ?

    Hi all,
    I am using Sun One Studio 3.0 with iWS6.0.
    For every new application that I write, compile and execute,
    it is getting deployed to the same
    directory.
    Because Sun One Studio is always using the same directory,
    for every application I have
    to manually delete the deployment directory.
    Is there any way to set different deployment
    directory for every new application that I write ?
    If yes, how to do this ?
    Thanks
    Swap

    I dont have the product installed, so I cannot try it right now. But I think the context root is part of the directory name in which the application is deployed. By default the context root is empty. If you change that, your application would be deployed in a different directory. To change context root, right click on WEB-INF node, and select "Properties" from the menu.
    Alternatively, you could try changing the directory name by right-clicking on the web.xml node under WEB-INF. You should see an iWS tab on the property sheet, where you could enter a directory name.

  • How to set the cardinality property as 1..n for a dynamically created node

    Hi...everybody
        I am creating Dropdown by index UI element and the
    context atrributes dynamically.To bind multiple data to a dropdown
    the cardinality property of the node should be 0..n or 1..n,
    But i could not set the property of the dynamically created context node to 0..n ...
    can any body suggest me..
    I implemented the following code in WDDoModify View
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
              null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    I could successfully display one value in the drop down,by adding the following code before the line tc.addchild(dbyindex);
    IWDNode node1=wdContext.getChildNode("DynamicNode",0);
    IWDNodeElement nodeElement=node1.createElement();
    nodeElement.setAttributeValue("Value","Hello");
    node1.addElement(nodeElement);
    but when
    i am trying to bind multiple values i am getting Exception ,,,,

    hi
    you are getting the exception because of cardinality property.
    i.e   true,false and
    you are trying to add morethan one element.
    so,if you want to add morethan one than one element you have to set the cardinality property to true,true (or) false,true.
    In your code do the following modification for changing the cardinality.
    For 0..n -->false,true
          1..n-->true,true
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
    null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    hope this will solve your problem.
    In addchild(..) the parameters are
    addChild("Name ,
                    Element class for model node ,
                    Is singleton? ,
                    Cardinality ,
                    Selection cardinality ,
                    Initialise lead selection? ,
                    Datatype ,
                    Supplier function ,
                     Disposer function);
    Regards
    sowmya

  • Where to look for log files & crash reports to help debug lockups?

    Where would I look for possible log files or crash information that may provide clues on what the problem is?
    Three or four times in the past few days my system has became unresponsive requiring a power-cycle. The little prism-colored round-cursor appears. I can drag windows about with my BlueTooth mouse (but not the trackpad) and that's about. The Function keys are not responsive. Other times the UI may becomes totally unresponsive.
    A couple of weeks ago I Carbon Copy cloned my hard drive to a new 500GB Hitachi 7200 RPM ( I have 200GB free space now ). Before upgrading, I do not recall having had this problem. It usually occurs when I am running a Linux Red Hat Enterprise Linux 5.2 VM under Parallels. Parallels may have nothing to do with it as that's what I do all day ( develop Linux software in a VM ).
    I have a MacBook Pro 2.4Ghz, OS X 10.6.3.
    Thanks in advance for any tips or suggestions,
    -Ed

    This is a Mac OS X issue. I am not using Boot Camp or otherwise dual-booting. I am running Linux in a virtual machine under a Parallels Mac OS X host; in effect running Linux as an application under OS X.
    Unfortunately I did not see any clues in either log file location. Thank you very much for explaining where to look. I ran Disk Utility and repaired a bunch of permissions. Perhaps I should have done this before and after making the Carbon Copy clone.
    -Ed

  • HT1751 Where to look for backup files on computer?

    need my back up information but cannot seem to find it on my computer. Where am i suppose to look for it?

    Hi Ashwin.Shalom,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    iTunes: About iOS backups
    http://support.apple.com/kb/ht4946
    Where are iTunes backups stored on your computer
    The folder where your backup data is stored depends on the computer's operating system. Make sure the backup folder is included in your data-backup routine. iTunes places the backup files in the following places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    The "~" represents your Home folder. If you don't see Library in your home folder, hold Option and click the Go menu.
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    To quickly access the Application Data folder, click Start, and choose Run. Type %appdata% and click OK.
    Windows Vista, Windows 7, and Windows 8: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    To quickly access the AppData folder, click Start. In the search bar, type %appdata% and press Return.
    I hope this information helps ....
    Have a great day!
    - Judy

  • JPanel: How to set the defualt size

    Hi there.
    When I run my application the main window is always too small. How can i set it to a reasonable size??
    Thank you for any hints u may provide.

    import java.awt.*;
    import javax.swing.*;
    public class SizeExample {
        public static void main(String[] args) {
            JPanel p = new JPanel();
            p.setPreferredSize(new Dimension(200,200)); //<<--
            JFrame f = new JFrame("SizeExample");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(p);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }The secret is, if a component isn't sizing itself properly, you can trying
    giving it a preferred size, then telling the top level window (JFrame in my example)
    to pack() -- which tries to give component's there preferred sizes,
    if their containers' layout managers will allow it.

  • How to set the portlet preference per user instead of global setting

    Hello All
    I am using IBM JSR168/ JSF, In my portlet Edit mode I am trying to set a value per user preference , but it always set for all other users even this is just a normal user, I think when an administrator set any preference value then those preferences value will be set for all the users. but in my case it is a normal user has right for the edit mode and hence the preference set by the user in edit mode will be set for his portlet instance only. So why it sets for all the users preference???...... Thanks a lot for your help!!!
    here is my code:
    ///////////portlet.xml//////////
    <preference>
                        <name>RowsPerPage</name>
                        <value>25</value>
                        <read-only>false</read-only>
                   </preference>/////////////////////////pageCode in edit mode do the save action/////////////////////////
    public String doSaveAction(){     
               FacesContext ctx = FacesContext.getCurrentInstance();
                  HttpSession session = (HttpSession)ctx.getExternalContext().getSession(false);
                  if(session != null) {
                       session.setAttribute("save", "save");
                       session.setAttribute("Number",Integer.toString(getNumber()));
               return "";
    }/////////////////////store the preference value///////
    public class MyPortlet extends FacesGenericPortlet {
    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException {
              try{               
                //String save1 = actionRequest.getParameter("save");
                String save = (String) actionRequest.getPortletSession().getAttribute("save");
                if (save != null){
                   PortletPreferences prefs = actionRequest.getPreferences();
                   String number= (String) actionRequest.getPortletSession().getAttribute("Number");
                   prefs.setValue("Number", number);
                   prefs.store();
              }

    Hope someone really can help me for this issue... I just wondering is this related to the user group config in portlet, since the interesting is that this issue is not apply to wpsadmin , but not sure where and how to set other user group that can set the preference no problem??
    Thanks for your time !

  • RMI Server behind Router: How to set the right IP?

    Hi, I am having trouble with the Server of an RMI application, the set up is this:
    1. The server is not always running on the same host: it may be a computer with a publicly visible and unique IP, or it may be under a computer behind a router.
    2 . The user that runs the server may not know how to get his IP in the router environment.
    3. The user that runs the server knows sh*t about rmiregistry or how to set a Property to the java interpreter (for example: -Djava.rmi.server.hostname=<host>).
    4. The Server code is this:
    * Represents the Server to the Domination app (including the chat plugin).
    public class Server {
         private static final int PORT_NUM = 1099;
         private static final String CHAT = "chat";
         private static final String DOMINATION_FACTORY = "Domination";
          * Sets the Chat and Application Servers.
          * @param args
          *            Never used.
         public static void main(String[] args) {
              try {
                   Registry registry = LocateRegistry.createRegistry(PORT_NUM);
                   Chat chatObject = new ChatImpl();
                   UnicastRemoteObject.unexportObject(chatObject, true);
                   UnicastRemoteObject.exportObject(chatObject, PORT_NUM);
                   registry.rebind(CHAT, chatObject);
                   System.out.println("Chat ready...");
                   Fabrica fabricaObject = new FabricaImpl();
                   UnicastRemoteObject.unexportObject(fabricaObject, true);
                   UnicastRemoteObject.exportObject(fabricaObject, PORT_NUM);
                   registry.rebind(DOMINATION_FACTORY, fabricaObject);
                            System.out.println("Domination Factory ready...");
                   System.out.println("All systems up and running");          
              } catch (Exception e) {
                   e.printStackTrace();
                   System.exit(1);
    }I wrote the code that way (and not using Naming.rebing("//" + host_name + "/Service", serviceObject)) so the server user won't need to run the rmiregistry (In fact, the Server is deployed via a jar file, so just a happy double-click to the jar will do the work)...
    OK, then the problem is this: The client is always having "connection refused" Exceptions while the server is behind a router and not in the same network of the client.
    The IP that is shown in the exception is always the inner IP of the host (or 10.x.x.x or 192.168.x.x or whatever it may be). So it seems that the registry is always choosing that IP and not the router's.
    I need to know if there is a way to rewrite the Server code so the user just should do the same 'double-click' to run the server and not mess around "investigating" the outer IP. I read some of the RMI specs and it suggest to do IP Tunneling and some other techniques that I don't think may be appropiate to the nature of this "roaming server" application.

    Thanks, but that still doesn't do the work. As I stated in the post, not every user will know how to set java.rmi.server.hostname or even look for an outer IP... I was asking for an "automagical" way to code my server class so it could do some job to do the guessing.
    Even though... I tried both ways at home with the help of a friend as the client, and it seemed to work. The client connected to the server but it was kicked out in less than 30 seconds. Being specific, every client, the ones inside and the ones outside my network. As if the only right way was to let the JVM set the IP (but again, in that way the server is invisible to the clients outside the network).

  • How to set the  Upload Destination Directory for RichFileUpload ?

    Hi! I'm using the RichFile Upload component for uploading the files to server..
    I have configured the file the size to be uploaded, but could not set the destination directory... The web.xml entries I have in my project is:
    <context-param>
    <!-- Maximum memory per request (in bytes) -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY</param-name>
    <!-- Use 500K -->
    <param-value>512000</param-value>
    </context-param>
    <context-param>
    <!-- Maximum disk space per request (in bytes) -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
    <!-- Use 5,000K -->
    <param-value>5120000000</param-value>
    </context-param>
    <context-param>
    <!-- directory to store temporary files -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_TEMP_DIR</param-name>
    <!-- Use an ADFUploads subdirectory of /tmp -->
    <param-value>/tmp/TrinidadUploads/</param-value>
    </context-param>
    <filter>
    <filter-name>trinidad</filter-name>
    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    </filter-mapping>
    By default the uploaded files are stored in :
    /u01/home/developer/.jdeveloper/system11.1.1.0.17.45.24/o.j2ee/embedded-oc4j/config
    I'm using Linux OS and JDev11g .
    Why is the desination directory configured in web.xml not being used?
    Am I doing any thing wrong?
    Any suggestions ?
    Thanking you,
    Samba

    Hi! Ric,
    This is the entire web.xml :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <!-- Maximum memory per request (in bytes) -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY</param-name>
    <!-- Use 500K -->
    <param-value>512000</param-value>
    </context-param>
    <context-param>
    <!-- Maximum disk space per request (in bytes) -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
    <!-- Use 5,000K -->
    <param-value>5120000000</param-value>
    </context-param>
    <context-param>
    <!-- directory to store temporary files -->
    <param-name>org.apache.myfaces.trinidad.UPLOAD_TEMP_DIR</param-name>
    <!-- Use an ADFUploads subdirectory of /tmp -->
    <param-value>/tmp/TrinidadUploads/</param-value>
    </context-param>
    <filter>
    <filter-name>trinidad</filter-name>
    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/afr/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <ejb-local-ref>
    <ejb-ref-name>ejb/local/SessionEJBLocal</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>com.prapansol.demos.SessionEJBLocal</local>
    <ejb-link>SessionEJB</ejb-link>
    </ejb-local-ref>
    </web-app>
    And about the other details you asked :
    1. I'm not using any custom UploadFileProcessors.. I'm using the default one.
    2. I tried with and with out the TrinidadUploads directory
    But still the same effect!
    Can you suggest where I'm going wrong?
    Thankyou
    Samba

  • I purchased my imac in the United States and now I live in the United Kingdom. How do I set the computer to know where we live as it defaults to US settings and I am having trouble registering my iphone

    I purchased my imac in the United States and now I live in the United Kingdom. How do I set the computer to know where we live as it defaults to US settings and I am having trouble registering my iphone. I had used it in the US for two years.

    You're Welcome..
    See Here for
    Changing Account Information
    http://support.apple.com/kb/HT1918
    Changing iTunes Store Account
    http://support.apple.com/kb/HT1311
    Apple ID FAQ
    http://support.apple.com/kb/HE37

  • How to set the PATH in Terminal?

    As a newbie to Bash and the Terminal, in connection with installing a new version of Ruby and various add-ons, I have been messing around with changing the PATH via various methods I've found on the internet, and trying to add a new directory to my PATH. Unfortunately, I cannot figure out how to set the PATH correctly. Here is what I understand so far:
    1. Bash first looks to ".bash_profile" in the home directory for PATH settings.
    2. If none, Bash then looks to ".bash_login" for PATH settings.
    3. If none, Bash then looks to ".profile".
    4. If none, Bash then looks to a system file in "/etc/profile" for default PATH settings.
    5. For a new shell after login, Bash looks for a ".bashrc" file.
    I cannot find any of the above files (I have Finder set to show hidden files already). Somehow, following some instructions from the internet without really knowing what I was doing over the past week I have set my PATH as follows:
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/*****/src:/usr/X11/bin
    but I cannot find the file that is setting this PATH. I have tried creating a new ".bash_profile" shell file and putting it in various places such as "/bin" and "/usr/bin" but the file is not being read.
    * As a temporary workaround I tried using the command "source .bash_profile" upon login to set the PATH using the .bash_profile file that I created, but it does not work.
    * I am able to temporarily alter the path using the command "PATH=/usr/local/bin:$PATH" but this only lasts for an active shell; when I close out and reopen a new shell, it reverts to the default.
    So my questions are:
    Is it correct that there is a "/etc/profile" somewhere that is setting the default PATH? If so where is it? Should I alter it, or create a new ".bash_profile" somewhere to set the PATH? If not, where is my PATH being set? If I should create a new ".bash_profile", what exactly should go in it?
    Thanks in advance for any assistance.

    ... I created a new ".bash_profile" file directly under my home directory and it worked like a charm. Below is the content of the file:
    "PATH=/usr/local/bin:/bin/:/sbin/:/usr/bin/:/usr/sbin/:/Users/******/Ruby:/Users/*******/src:/Users/******/Java Programs/"
    What are the "..."'s? Is that just you, or is the contents of the file actually inside of double quotes?
    is there an 'export PATH' also in the file? As in
    PATH=/usr/local/bin:/bin/:/sbin/:/usr/bin/:/usr/sbin/:/Users/******/Ruby:/Users/*******/src:/Users/******/Java Programs/
    export PATH
    And did you either restart your Terminal session so your .bash_profile was read, or issue a 'source .bash_profile' command to execute the .bash_profile after your change?
    The only remaining problem is that from the home directory, I'm unable to directly run programs in the above-designated subdirectories (without first navigating to the subdirectory containing the file. Is there something wrong with the syntax or order of the directories I put in the path?
    For example: there is a file called "newprogram.rb" in the "Ruby" directory listed above. I should be able to execute it from the home directory using "ruby newprogram.rb" but it does not work. The same command works fine from within the "Ruby" directory.
    Does the 'ruby' command search PATH to find its scripts?
    Have you read the "man ruby" man page to see if it talks about PATH?
    A common Unix feature is that programs and scripts with the executable bit set, and are located in a PATH directory, will be run if you just type their names.
    For example, if the first line of newprogram.rb script starts with
    #!/usr/bin/ruby
    and if the script is executable
    chmod +x newprogram.rb
    And if it is in a directory in PATH, then just typing
    newprogram.rb
    should run your perl script using /usr/bin/ruby. If you want to use a different version of Ruby, then change the #! line so it point to your version of Ruby. Or if your version of Ruby is found earlier in PATH then the /usr/bin/ruby, you can use
    #!/usr/bin/env ruby
    as your script's first line which will search PATH for 'ruby' and use the first one it finds.
    Message was edited by: BobHarris

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

Maybe you are looking for