Getting Java Started

Hi I just recently installed RedHat Enterprise Linux WS Version 3 for i386 and installed J2se 1.4.2 SDK. I go into the directory with my .java and .class files and javac HelloWorld.java and get the error: bash: javac: command not found
Now I just started using Linux today and have been writing java programs for only about 5 weeks since I just started this class. So I am totally lost on what to do so that Linux will run the compiler or apletviewer. If anyone could give me some help or point me to a site on how to set up linux so that it will refer back to the compiler when i try to use it in Terminal. Thanks
Chris

Above, $SHELL is a shell variable, or environment variable. The "environment" is a collection of name/value pairs that describe the environment you're working under. One of these environment variables is PATH, which tells the shell what directories to look in to execute the commands you give on the command-line shell.
So if you type:vi MyProg.java the "vi" is the command you want to execute and "MyProg.java" is an argument to vi; in this case it's the name of a file you want to edit. The shell reads this command line, determines that you want to run the "vi" program, then looks in each directory in its PATH to find a program named "vi". If it finds it, it executes it.
When you add new programs, sometimes you want to put them on the path. You must not remove the stuff that's already on your path, because if you do you won't be able to find some programs. So what you do is you append a new directory to the end of the path.

Similar Messages

  • Java: UNKNOWN getting at Starting Installation stage for EP7.0 DI installat

    Hi,
    I am Installing EP7.0 Dialog Installation on new host. I am getting Java: UNKNOWN error in starting Instance phase. Already I have installed a new DI on another box for same CI without this issue. Both boxes are same config and memory parameters..
    OS solaris
    DB: Oracle
    Here is the error from sapinst log
    TRACE      2008-06-19 15:06:27.843
    2008-06-19 15:06:27.842 NWInstance.isAlwaysUnicode() done: false
    TRACE      2008-06-19 15:06:27.845
    2008-06-19 15:06:27.844 NWInstance.isAlwaysUnicode() done: false
    TRACE      2008-06-19 15:06:27.925
    2008-06-19 15:06:27.924 NWInstance.getMyName() done: sctpitsun204_EPQ_12
    TRACE      2008-06-19 15:06:27.927
    2008-06-19 15:06:27.926 NWDialogInstance._getRunningState() done: UNKNOWN
    TRACE      2008-06-19 15:06:27.929
    2008-06-19 15:06:27.928 NWDialogInstance.isJavaRunning() done: UNKNOWN
    TRACE      2008-06-19 15:06:27.933
    2008-06-19 15:06:27.932 NWDIState(NWDialogInstanceInstall(EPQ/J12/sctpitsun204), 1201, 30, undefined, UNKNOWN, undefined)
    TRACE      2008-06-19 15:06:27.936
    2008-06-19 15:06:27.935 NWInstState(NWDialogInstanceInstall(EPQ/J12/sctpitsun204), 1201, 30, undefined)
    TRACE      2008-06-19 15:06:27.938
    2008-06-19 15:06:27.937 NWInstState() done
    TRACE      2008-06-19 15:06:27.940
    2008-06-19 15:06:27.939 NWDIState() done
    TRACE      2008-06-19 15:06:27.942
    2008-06-19 15:06:27.941 NWDialogInstance.getRunningState() done: Java: UNKNOWN
    TRACE      2008-06-19 15:06:27.945
    2008-06-19 15:06:27.943 NWDIState.assertStateProgress(Java: UNKNOWN)
    TRACE      2008-06-19 15:06:27.947
    2008-06-19 15:06:27.946 NWDIState._assertABAPStateProgress(undefined, undefined)
    TRACE      2008-06-19 15:06:27.949
    2008-06-19 15:06:27.948 NWDIState._assertABAPStateProgress() done
    TRACE      2008-06-19 15:06:27.951
    2008-06-19 15:06:27.950 NWDIState._assertJavaStateProgress(UNKNOWN, UNKNOWN)
    TRACE      2008-06-19 15:06:27.954
    2008-06-19 15:06:27.952 NWDIState._assertABAPStateProgress() done
    TRACE      2008-06-19 15:06:27.955
    2008-06-19 15:06:27.954 NWDIState.unbalancedStates()
    TRACE      2008-06-19 15:06:27.958
    2008-06-19 15:06:27.956 NWDIState.unbalancedStates() done: false
    TRACE      2008-06-19 15:06:27.960
    2008-06-19 15:06:27.958 NWDIState.assertStateProgress() done
    TRACE      2008-06-19 15:06:27.962
    2008-06-19 15:06:27.960 NWInstState.getElapsedString()
    TRACE      2008-06-19 15:06:27.964
    2008-06-19 15:06:27.963 NWInstState.getElapsedString() done: 20:00
    TRACE      2008-06-19 15:06:27.966
    2008-06-19 15:06:27.965 NWDIState.isRunning()
    TRACE      2008-06-19 15:06:27.968
    2008-06-19 15:06:27.967 NWDIState.isRunning() done: false
    TRACE      2008-06-19 15:06:27.970
    2008-06-19 15:06:27.969 NWDIState.assertTimeout()
    TRACE      2008-06-19 15:06:27.972
    2008-06-19 15:06:27.971 NWDialogInstance.getMaxWaitTime(true)
    TRACE      2008-06-19 15:06:27.974
    2008-06-19 15:06:27.973 NWDialogInstance.getMaxWaitTime() done: 1200
    TRACE      2008-06-19 15:06:27.976
    2008-06-19 15:06:27.975 NWDIState.assertJavaTimeout(1200)
    TRACE      2008-06-19 15:06:27.979
    2008-06-19 15:06:27.977 NWInstState.getElapsedString()
    TRACE      2008-06-19 15:06:27.981
    2008-06-19 15:06:27.980 NWInstState.getElapsedString() done: 20:00
    TRACE      2008-06-19 15:06:27.986
    NWException thrown: nw.progress.waitingForStartJavaFailed:
    Java processes of instance EPQ/J12 [Java: UNKNOWN] did not reach state PARTRUNNING after 20:00 minutes. Giving up.
    TRACE      2008-06-19 15:06:27.986
    Function setMessageIdOfExceptionMessage: nw.progress.waitingForStartJavaFailed
    WARNING[E] 2008-06-19 15:06:27.988
               CJSlibModule::writeError_impl()
    CJS-30150  Java processes of instance EPQ/J12 [Java: UNKNOWN] did not reach state PARTRUNNING after 20:00 minutes. Giving up.
    I appriciate any responses.
    Thanks
    Sri.

    it says , j2EE is trying to come up but some how dying during the startup. looks like memory exhaustion.
    what's the status of dispatcher, is it also down aswell. please provide dev_server0 log
    -durga

  • Getting Java running

    I have downloaded j2sdk1.4.0-beta 3 onto my computer which operates on windows 98. the install wizard installed the program and created a folder j2sdk1.4.0-beta 3. If I click on this it opens to reveal other folders, but when clicking on these they continue through and nothing ends up happening.
    I have tried to follow the installation notes on the website and it discussed setting the path through the autoexec.bat. Now, this did not come up as a dos prompt set up, but rather a window under the system reconfigure window (and a bunch of others). the autoexec window started off
    @ECHO OFF
    SET BLASTER=A220 15 DI
    LH C:\WINDOWS COMMAND\DOSKEY
    So I am not even sure if this is where I am supposed to be and don't want to reset something that will effect the rest of my system.
    I've spent several hours trying to figure this out and can't get java running, if anyone can help It would be greatly appreciated!!!! Thanks in advance!!

    You need to set up the autoexec.bat file so msdos knows where to look for the javac.exe (compiler) and java.exe (run time enviroment) and other such fun stuff.
    To do this is fairly straight forward - if the JDK root directory is on your c: drive in the folder jdk1.2.2, so the path name for that folder would look like "C:\jdk1.2.2". To tell msdos where the compilers and such are add the following (changing the JDK pathname if JDK is in a different location on the c drive):
    SET CLASSPATH=.;C:\
    PATH=C:\JDK1.2.2\BIN
    Now, when you open the command line/msdos prompt you will need to run the autoexec.bat file, so in the case above, it will look in "C:\JDK1.2.2\BIN" when you run javac, java, jardoc etc.... To run it type "autoexec.bat" whilst in the same directory as the autoexec.bat in msdos - you will need to do this each time you activate the msdos prompt - how to set it up so it does it automatically i don't know.
    You don't need to change anything else in the autoexec.bat file, and you can copy the autoexec.bat into the directory in which you are developing the java code. You will need to leave the orginal for other programs to use.
    As for opening the JDK folders and your computer not doing anything, i think their maybe a problem with the computer itself............

  • Any way to get Java Plug-In-like handling of jar versions?

    I have jars intended for use with the Java Plug-In with version #'s in properties files (computed by the various tooling for updating these on the server). The jars themselves have no notion of jar #.
    I would like to re-use these jars and version #'s with Java Web Start to avoid conditional GETs, but without jar diffing in this case (as I already have many small jars due to lack of jar diffing in the Java Plug-In).
    Is there any way I can get Java Web Start to act like the Java Plug-In in this regard (i.e. the jar version # is a statement from the server, the client does a normal GET against the jar URL if its own version is not that stated by the server)?
    [Don't get me wrong, jardiffing is cool, but having to do everything differently between Java Web Start and the Java Plug-In is [b]not cool.

    Best way IMO would be to create a Socket connection to it so that you could connect with a client app and feed in data that way

  • Getting java.classNotFoundException even if the class is there

    Hi all,
    We've recently migrate to jdeveloper 11g production. Our fusion web application used to work perfectly with jdeveloper 11G P4 when running on OC4J. We use the whole ADF Framework on each business layer.
    I'm getting java.classNotFoundException on 11G prod, and the strange thing is : class is present ! I've looked everywhere ; and made sure the missing class is just imported once (not twice or more, wich was the default case). Anyway, here's the log :
    I'm willing to past xmls files if necessery, or others.
    ----  Deployment started.  ----    Oct 22, 2008 1:33:35 PM
    Target platform is  (Weblogic 10.3).
    Running dependency analysis...
    2008-10-22 13:33:35.355: Writing WAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA\EASYTEAM GDA-ViewController-webapp
    2008-10-22 13:33:35.704: Wrote WAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA\EASYTEAM GDA-ViewController-webapp
    2008-10-22 13:33:35.81: Writing WAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA\EASYTEAM GDA-Model-webapp
    2008-10-22 13:33:35.863: Wrote WAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA\EASYTEAM GDA-Model-webapp
    2008-10-22 13:33:37.044: Writing EAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA
    2008-10-22 13:33:37.053: Wrote EAR file to D:\OracleJDev11G\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\EASYTEAM GDA
    Deploying Application...
    <22 oct. 2008 13 h 33 CEST> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application EASYTEAM GDA is not versioned.>
    <22 oct. 2008 13 h 33 CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1224675217485' for task '6'. Error is: 'java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentELTag'
    java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentELTag
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentELTag
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    >
    <22 oct. 2008 13 h 33 CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'EASYTEAM GDA'.>
    <22 oct. 2008 13 h 33 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentELTag
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: javax.faces.webapp.UIComponentELTag
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    >
    [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application EASYTEAM GDA on DefaultServer.: javax.faces.webapp.UIComponentELTag.
    weblogic.application.WrappedDeploymentException: javax.faces.webapp.UIComponentELTag
    ####  Deployment incomplete.  ####    Oct 22, 2008 1:33:40 PM
    oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
         at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
         at oracle.jdevimpl.runner.adrs.AdrsStarter$4$1.run(AdrsStarter.java:1316)
    Caused by: oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
         ... 11 more
    Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
         ... 12 more
    #### Cannot run application EASYTEAM GDA due to error deploying to DefaultServer.
    [Application EASYTEAM GDA stopped and undeployed from Server Instance DefaultServer]

    Hi,
    are you sure that the library is deployed to the server?
    Check the application in the deployed path on the server. If you don't find the library there check the Library and classpath in your project settings if the library which contains the jar has the checkbox 'deploy ba default' set.
    Timo

  • How can I get the start date and end date of a certain week?

    Hello, in my java code, I can get the week ID , using
    org.joda.time.base.AbstractDateTime.getWeekOfWeekyear() , for example, this week is the 16th week of this year. And I want to get the start date(date of Monday) and end date(date of Sunday) of the week. Is there any method can supply such date value??thanks

    1 public Date getCurrentMonday(){
    2 Date monday = null;
    3 Calendar rightNow = Calendar.getInstance();
    4 int day = rightNow.get(Calendar.DAY_OF_WEEK);
    5 int distance = 0;
    6
    7
    8 if (day == Calendar.MONDAY)
    9 monday = rightNow.getTime();
    10 else
    11 {
    12 distance = day - Calendar.MONDAY;
    13 if (distance == -1)
    14 distance = 6;
    15
    16 monday = (Date) (rightNow.getTime());
    17 monday.setTime(monday.getTime() - 1000 *60 *60 *24 *(distance));
    18 }
    19 return monday;
    20 }

  • Can't get java to run in MS-DOS

    Can someone out there, help me with a execution problem, am having in running java. I install jdk1.3 from a CD in a book(Java 2 by Andy Harris). I,am running under window98, with lots of spaces and memory. Each time I would try to execute a java module, the DOS screen would come up and then drop away. I have re-install the software. same problem, I have try run under DOS(coming out of window and restarting in DOS), same problem, so I log on the SUN web site and downloaded j2se1.4 install it try running it and still got the same problem, The screen up with data on it and just go away. What is wrong here!! [email protected]

    Yes! They are right.. We should run java in on windows, not on pure DOS. So restarting in DOS mode would not help.
    1. Start windows
    2. Click on Start -> Run
    3. Type Command and hit enter
    4. This should bring up DOS command prompt.
    5. Type "java" in at the command prompt
    6. If it gives you some suggestions about how to run java. If it says "Bad command" java.exe is not in the path. Find java.exe and append it to PATH environment variable.
    7. Once you get java working - open the command prompt as told earlier and run the java program by typing the command
    java <Main Class Name>
    8. Doing it this way would help you find out if there are any error messages.
    Your DOS window is closing because there was an error or your program finishes running. If you open DOS prompt first and then run java program it would not close the window and you will be able to see the error messages in the same DOS windows.
    Hope this helps..

  • Getting Java console error when trying to display the PO

    Hi All,
    In the approved shopping cart when we select any item details and when we go and see the follow-on documents we get two options to select 1) Display as Graphic 2) Display as Table. When we are select the option 2 display as table we are able to see the shopping cart and also the PO and further when we click on the PO it is displaying the order details.
    However when we go by option 1 display as graphic, we are able to get the details of the shopping cart and PO, but when we try to click on the PO we get Java error indicating as follows. "Error. Click for details". when we click the on the error a window will apper and indicates that Application failed to run.
    we installed the latest version Java and tried still we are getting the same error. Can any body help me in this.
    Java Plug-in 1.6.0_18
    Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
    User home directory = J:\Documents and Settings\****
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
         at java.lang.String.charAt(Unknown Source)
         at VisnetMain.readParameter(VisnetMain.java:141)
         at VisnetMain.init(VisnetMain.java:60)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    java.lang.NullPointerException
         at VisnetMain.start(VisnetMain.java:3770)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.NullPointerException

    Hi psamp1,
       Were you able to solve this problem?
       We have exactly the same issue...
    Thanks
    John
    Edited by: John Chinnappan on Mar 29, 2011 8:06 AM

  • Getting Java error While click on Test model for New configuration.

    From ” Configurator Administrator responsibility” we use the below link and getting Java Error:
    Log in -> Configurator Administrator responsibility -> Configurator Developer -> Simple Search -> Item Name: r100s -> Click Edit -> Click Test Model -> select Start New Configuration -> Click Next -> select Model UI -> Click Finish -> get java.lang.NullPointerException.
    If any body have encountered the same error , Please let me know the solution.
    Regards,

    Below is the Error:
    [Dec 1, 2009 9:48:51 AM GMT+00:00]:1259660931381:Thread[Thread-127,10,main]:1467:85913090:essapdu31z1.emrsn.com:10.236.93.46:27619:27620:EXCEPTION:[cz.servic
    e.ConfiguratorServiceLocal.From processMessage()]:[null_3a1685d_2 # 31] null
    java.lang.NullPointerException
    at oracle.apps.cz.service.ConfiguratorService.fetchModeldata(ConfiguratorService.java:1708)
    at oracle.apps.cz.service.ConfiguratorService.processMessage(ConfiguratorService.java:447)
    at oracle.apps.cz.service.ConfiguratorServiceLocal.onMessage(ConfiguratorServiceLocal.java:18)
    at oracle.apps.cz.runtime.PageController.postServiceMessage(PageController.java:535)
    at oracle.apps.cz.runtime.PageController.fetchModelData(PageController.java:707)
    at oracle.apps.cz.runtime.oa.server.CZApplicationModuleImpl.submitDataRequest(CZApplicationModuleImpl.java:954)
    at oracle.apps.cz.runtime.oa.webui.AbstractMainPageController.getModelData(AbstractMainPageController.java:547)
    at oracle.apps.cz.runtime.oa.webui.AbstractMainPageController.loadPageStructure(AbstractMainPageController.java:2313)
    at oracle.apps.cz.runtime.oa.webui.MainPageController.processRequest(MainPageController.java:65)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    Regards

  • (Example) Books to get me started

    Hi,
    I am new to Java programming and besides the Herbert Schildt's, "Java2: The Complete Reference" book (required by instructor), I would like to purchase some other books to get me started into the subject.
    I am specially interested about books loaded with examples; I am more of a practical learner vs an abstract one.
    Please post your recommendations.
    Thanks.

    Before you go out buying more books take advantage of free:
    http://java.sun.com/developer/onlineTraining/
    http://java.sun.com/developer/codesamples/#javase
    http://www.mindview.net/Books/TIJ/ (Thinking in Java: buy or read on web)
    and I also like:
    Head First Java, 2nd Edition by Kathy Sierra and Bert Bates
    But please do not get mixed up about learning Java and learning to program--Java is the tool and programming is the actual method.

  • Getting java.io.FileNotFoundException: Too many open files

    I have search for different strings in a file again and again. I am using following code:
    try
                   fileReaderObject = new BufferedReader(new FileReader(fileObject));          
                   String inputLine;
                   while ((inputLine = fileReaderObject.readLine()) != null)     
                        if (zipCode.equalsIgnoreCase(inputLine.split("\t")[0]))
                             s = inputLine;     
                             fileReaderObject.close();
                             return s;
                   fileReaderObject.close();
              catch (Exception e)
                   Utils.writeMessage(e.toString());               
                   e.printStackTrace();               
              }But getting java.io.FileNotFoundException:file/emp_info (Too many open files)
    1. Whats the main reason of this exception and how can it be removed.
    2. Is there any way to move the pointer to the start of the file. I tried reset() but its seems to have some problem.
    -vc

    A hint: your fileReaderObject is not closed if an exception occurs.
    Lacking desctructors, the Java-ish way is to close in a finally clause.

  • Getting java.lang.LinkageError: duplicate class definition after new build

    I few weeks ago I started getting :
    java.lang.LinkageError: duplicate class definition every time I tried to access a web app that just got a fresh ANT build to the the web server. The error sites the application's primary servlet class. When I bump the server on I-Planet (6.0), the error goes away. I cannot find a duplicate class anywhere, though. I'm stumped.

    I few weeks ago I started getting :
    java.lang.LinkageError: duplicate class definition every time I tried to access a web app that just got a fresh ANT build to the the web server. The error sites the application's primary servlet class. When I bump the server on I-Planet (6.0), the error goes away. I cannot find a duplicate class anywhere, though. I'm stumped.

  • Java Start Up.app

    I deleted my utilities folder and it had that app in it dose any one know where I can download "Java Start Up.App" for mac OS X 10.4.11 (I went to javas site and it said to got to "Software Update" I did and there was no new downloads)

    Hi Kev, I think you have two choices...
    #1 Do a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.
    #2 Get Pacifist...
    http://www.charlessoft.com/
    then extract/install what you need from your Install Disc.

  • Getting java.lang.Null pointer Exception when i close the pdf file.

    Hi,
    my application is java based thick client application.
    From my application, i am generating report file using crystal report tool.
    the report file is exported as pdf format and stored in my local macine. from this path, am displaying the report in a SWT browser.
    till now its working fine. when i close the browser, i am getting java.lang.null.pointer exception.
    i dont understand from this exception, printed in console.
    please help me.
    java.lang.NullPointerException
    at org.eclipse.swt.ole.win32.OleClientSite.onPaint(OleClientSite.java:921)
    at org.eclipse.swt.ole.win32.OleClientSite.access$2(OleClientSite.java:906)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:131)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
    at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1424)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3842)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4541)
    at org.eclipse.swt.internal.ole.win32.COM.CoFreeUnusedLibraries(Native Method)
    at org.eclipse.swt.ole.win32.OleClientSite.releaseObjectInterfaces(OleClientSite.java:1084)
    at org.eclipse.swt.ole.win32.OleControlSite.releaseObjectInterfaces(OleControlSite.java:683)
    at org.eclipse.swt.ole.win32.OleClientSite.onDispose(OleClientSite.java:852)
    at org.eclipse.swt.ole.win32.OleClientSite.access$1(OleClientSite.java:847)
    at org.eclipse.swt.ole.win32.OleClientSite$1.handleEvent(OleClientSite.java:128)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:755)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at com.siemens.med.cad.hqm.reports.ReportViewer$1.widgetDisposed(ReportViewer.java:273)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
    at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
    at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
    at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:446)
    at org.eclipse.swt.widgets.Shell.dispose(Shell.java:674)
    at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
    at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1643)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3789)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2366)
    at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:477)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3877)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1576)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2371)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3420)
    at com.siemens.med.cad.hqm.view.mainUI.HQMMainForm.buildMainShell(HQMMainForm.java:246)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.loginDisplay(UserLoginEventHandler.java:240)
    at com.siemens.med.cad.hqm.event.UserLoginEventHandler.widgetSelected(UserLoginEventHandler.java:97)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
    this is the code i have written for display the report file in a browser:
    Display display = Display.getDefault() ;
         Shell shell = new Shell(display, SWT.RESIZE | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.APPLICATION_MODAL);
    shell.setText(reportTitle);
    shell.setLayout(new FillLayout());
    shell.setMaximized(false);
    shell.setSize(800, 600);
    Composite comp = new Composite(shell, SWT.NONE);
    comp.setLayout(new FillLayout());
    final Browser browser = new Browser(comp, SWT.FLAT);
    try {
    File file = new File(exportFile);
    URL url = file.toURL();
    browser.setUrl("file:" + url.getPath());
    } catch (MalformedURLException malURLEx) {
    // malURLEx.printStackTrace();
    throw new ProgrammingExceptionAdapter(malURLEx);
    shell.addDisposeListener(new DisposeListener() {
    public void widgetDisposed(DisposeEvent arg0) {
    File file = new File(exportFile);
    if (file != null && file.exists()) {
    file.delete();
    browser.dispose();
    shell.open();
    shell.setFocus()'

    TitiTruc, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • Hello I need help on getting java to work on my computer.

    Hello I when to a class during the summer learning java and it would be a shame to let this class go to waste.
    I have been emailing my teacher trying to get java to work but it hasn't been working out.
    I have tried to get a hole of him lately but I can't reach him anymore.
    So I decided to join this forum to hopefully get it to work.
    I was told to download Jedit.
    So I compiled it and then ran it.
    And it said.
    java.lang.NoClassDefFoundError: SwingUI
    Exception in thread "main" Process java exited with code 1
    What can I do to fix this?
    If there is any information that I must give about this situation that would help you understand my problem please tell me because I would really enjoy this to be fixed.

    I suggest DevSquare (http://www.devsquare.com). Its easy to get started as you dont require any set up on your machine and has good editor features like auto completion, templates, code navigation and prompt error messages support that redirect to the corresponding line in the code. You can also debug your applications and refactor your code using this tool. I found it quite useful as it also has a code base where code bytes are availble.
    Refer to the links below to overcome the issues faced by you.
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/
    http://java.sun.com/developer/onlineTraining/Programming/BasicJava1/compile.html
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/learning/new2java/index.html

Maybe you are looking for