Can't get Eclipse 3.3 to compile servlets

Hi,
This is my first time tyring to compile a servlet in Eclipse 3.3. I have serveral errors like "Can not resolve import javax.servlet..." I did include the location of the servlet-api.jar file in my classpath. And not just classpath but I included the location to variables PATH, JAVA_HOME just in case but still no luck. I have browsed the web enough, and tried all the tricks of the trade. I am using jdk1.6_02 and tomcat 5.5.25.
Can anybody help,
Thanks in advance!
Codesingh!

Okay, let's start simple: An instance of Comparable<T> can be compared to instances of T (for any type T). Lets assume Numbers were Comparable:
class Number implements Comparable<Number> { /* ... */ }
class Integer extends Number { /* ... */ }
class Float extends Number { /* ... */ }This means an Integer can be compared to any Number, such as a Float or another Integer:
Integer ten = 10;
Integer five = 5;
ten.compareTo(five);Now let's write a generic function that can sort lists of items that are comparable with each other:
public static <T extends Comparable<T>> void sort(List<T> list) { /* ... */ }If you tried to pass a List<Integer> to sort, you would essentially substitute Integer for T, however Integer does not satisfy the upper bound of Comparable<Integer>. If we substitute Integer in the declaration you provided in reply 2
public static <T extends Comparable<? super T>> void sort(List<T> list) { /* ... */ }we get an upper bound of Comparable<? super Integer>. You're free to substitute "? super Integer" with a supertype[1] of Integer, such as Number and since Integer implements Comparable<Number> the substitution is valid and the call is legal.
Generics are all about substituting.. ;)
To answer the question of what does T extends Comparable<? super T> mean: It means you may substitute any type U for T where U is comparable to a supertype[1] of U.
With kind regards
Ben
[1] the super- and subtype relations are reflexive, in other words Integer is a supertype and a subtype of Integer.

Similar Messages

  • How can I get client IP address in portlet (servlet) ?

    How can I get client IP address in portlet (servlet) ?
    request.getRemoteAddr() return server IP.
    May be I must use Portal API, which extend Servlet classes, but I can't find this.
    Can any help me?

    Hi,
    Following query can help you to get the Client IP Address.
    select sys_context('userenv','ip_address') from dual;
    Thanks,

  • How can I get a parameter back into a servlet invoked from an IMG tag ?

    I'm using a servlet to create several graphical plots per JSP i.e. per HTML page. Each graph is supposed to be different, according to a parameter which I want to pass back from my JSP. I'm getting several plots but they're all the same!
    I've tried setting an attribute in the session object before each IMG SRC= , but all I get is each plot the same! In fact, my debugging efforts show that the servlet is only called once despite 3 calls, each with a different session parameter value. I'm not sure the session parameter values are getting used properly.
    I just can't find a way of getting a parameter back into my servlet which is invoked from the IMG tag (i.e. SRC= "servlet name").
    Can anyone tell me the best way to pass a parameter back into a servlet which is invoked from an IMG tag? Can the request object be used? I can't, at the moment, see how it could be used?
    I'll certainly be very grateful if anyone can help with this - could even be useful for others as well!

    You said that, "by moving a copy of Mobile Docs back to the Library, from which I had moved it, my documents reapperared in Cloud." That says that you actually moved it. Obviously, I can't tell exactly what you did, but it sounds like you may have thought you were just putting it in the sidebar, but you actually put it somewhere else. The sidebar is not a location to put things, just a way to create a quick shortcut to access a file or folder, so you can't put things "back" from there.

  • Can't get Eclipse from extra repo to work

    Hi
    After a long time I have to code an app in Java, so I want to install Eclipse because I know my way around that IDE. I found it in the extra repo, but when trying to run it I get an error
    An error has occurred. See the log file ~/workspace/.metadata/.log.
    The mentioned file has has the following in it:
    !SESSION 2010-01-06 13:37:21.459 -----------------------------------------------
    eclipse.buildId=M20090917-0800
    java.version=1.6.0_0
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_GB
    Command-line arguments: -os linux -ws gtk -arch x86
    !ENTRY org.eclipse.osgi 4 0 2010-01-06 13:37:22.375
    !MESSAGE Application error
    !STACK 1
    java.lang.UnsatisfiedLinkError: no swt-gtk-3555 or swt-gtk in swt.library.path, java.library.path or the jar file
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:254)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:159)
    at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:131)
    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:516)
    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
    at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:143)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:88)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
    Can anyone make sense out of this? It looks as if the swt library is missing but that isn't a dependency of eclipse. I tried to install the swt package from the repo but that doesn't help. I also get the same error with jre+jdk and openjdk6.
    EDIT: I also tried deleting ~/.eclipse and starting with a clean workspace directory, didn't help.
    Last edited by Ramses de Norre (2010-01-06 12:40:31)

    That's a good idea. I've looked at this post every time it comes up (obviously don't know the problem, and neither does anyone else I think).

  • Performanse Issue - can I get queries generated by JDO compiled?

    Hi,
    I have noticed that there is a huge improvemnt in performance when using
    compiled queries. However, when I navigate relationships, JDO generates
    the query internally and I would like to instruct JDO to compile these
    queries as well.
    If I replace the relationship type with a long to obtain a key from the
    database and then read the related record in a compiled query using this
    key, I have seen performance increase 10 times in batch runs.
    I would appreciate your advise on this as the current performance we
    have achieved with Kodo JDO is not acceptable for our application, but I
    believe it would be if these queries were issued with PreparedStatements
    as well.
    Lars

    Lars --
    Unfortunately there's not a lot you can do to control this behavior right now. However, we're working on a system in which we use a transparent PreparedStatement cache for all our database interactions. It should be ready in a few weeks. We hope you can wait that long, because we have some great things in store for Kodo users.

  • Can't get Tomcat to work with a servlet using JDBC

    Hi there! I'm running ubuntu 7.04 with Java 1.5 and Tomcat 5. Standard installation of both. I wrote a very simple servlet that just tries to connect to a mysql DBMS and I get this(stack trace):
    com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)
    com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
    com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
    com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
    java.sql.DriverManager.getConnection(DriverManager.java:525)
    java.sql.DriverManager.getConnection(DriverManager.java:171)
    Search.doGet(Search.java:21)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
    org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
    java.security.AccessController.doPrivileged(Native Method)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Thread.java:595)Do you have any idea where the problem is? Normal desktop application can connect to the DBMS flowlessly.

    Not sure this will help, but here goes:
    I looked through your stack trace for a phrase that is relatively unique and summarizes the problem. I then google searched on it.
    Here is what I googled on:
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    I found this that might be of help:
    http://dev.mysql.com/doc/refman/4.1/en/connector-j-usagenotes-troubleshooting.html#qandaitem-19-4-5-3-7
    In that document I found this:
    "The error probably indicates that you are using a older version of the Connector/J JDBC driver (2.0.14 or 3.0.x) and you are trying to connect to a MySQL server with version 4.1x or newer. The older drivers are not compatible with 4.1 or newer of MySQL as they do not support the newer authentication mechanisms.
    It is likely that the older version of the Connector/J driver exists within your application directory or your CLASSPATH includes the older Connector/J package.
    Also, the word 'NonRegisteringDriver' above indicates your JDBC (which is a driver_ is a non registering type.
    I suggest you hit the MySql home page and see if you can download a newer driver.

  • Can't get to the doGet in the servlet

    I have a java client using HttpURLConnection to talk to a servlet. No matter I use conn.setRequestMethod("GET"), which is the default method, or not, I always hit the doPost method on the servlet side. What did I miss? How do I get to the doGet method? I need to use the same servlet to get and post data to the server. I don't want to add a parameter telling the servlet that I am uploading or downloading.
    Thanks.

    Greetings,
    Thanks Tony. I didn't set the Content-Type before
    seeing your first reply :-). I tried several content
    types and none of them helped. This is the code
    before.
         conn = (HttpURLConnection)url.openConnection();
    conn.setUseCaches(false);
    conn.setDoInput(true);
    conn.setDoOutput(true);The only other thing that's out of place in the present situation is the call to setDoOutput(true) which is unnecessary since your client is not actually sending data to the server(?). However, I'm not sure this is causing the problem since I never set this for GET requests in my own projects (preferring, instead, to make a distinction in my clients between input - GET - and input/output - POST or PUT - operations and use a "method dispatching" framework in my servlet(s)...). ':) Anyway, the above looks "fine" and should result in a GET request being sent to the server, though you might remove the doOutput setting and see if it makes a difference. If not, then the error would seem to be not in the client but in the servlet...
    Regards,
    Tony "Vee Schade" Cook

  • I can't compile servlets

    Please ignore my previous Thread.
    Where do you get the nessecary libaries to compile servlets, and what directory of the JSDK1.4.0/ directory do you put them in (Im using Win98se)

    File To Compile:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloClientServlet extends HttpServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
         res.setContentType("text/html");
         PrintWriter out = res.getWriter();
              out.println("<HTML><HEAD><TITLE>Hello Client!</TITLE>"+
         "</HEAD><BODY>Hello Client!</BODY></HTML>");
              out.close();
         public String getServletInfo()
              return "HelloClientServlet 1.0 by Stefan Zeiger";
    Error Messages:
    C:\ServletDevelopment\HelloClientServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    C:\ServletDevelopment\HelloClientServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    C:\ServletDevelopment\HelloClientServlet.java:4: cannot resolve symbol
    symbol : class HttpServlet
    location: class HelloClientServlet
    public class HelloClientServlet extends HttpServlet
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class ServletException
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    6 errors
    Tool completed with exit code 1

  • Get JSON from HttpPost Entity on Servlet

    My Client Code:
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpRequest;
    import org.apache.http.HttpResponse;
    HttpPost post = createHttpPost(path);
    post.setEntity(toJsonEntity(obj));
    HttpResponse response = execute(post);
    My question:
    How can I get the Json object from my Servlet? I mean how can I get the back from HttpServletRequest?
    Thanks,

    Moderator action: moved here from the Generics forum where it was wildly off topic.

  • How can you get a compilation album to show up as one album rather than be split up but song and artist?

    how can you get a compilation album to show up as one album rather than be split up by song and artist? I've got loads of albums on iTunes that are compliations and they are all mixed up by track/ artist. Even when you click 'show album' it still just shows the album title and then the artist in alphabetical order - so the album is replicated several times
    Can anyone tell me how to amalgamate compliation albums please?

    This web page will help you: http://samsoft.org.uk/iTunes/grouping.asp

  • Where can I get a compiler?

    Where can I get a compiler that I can use that is like sun's but doesnt use an IDE?

    This may duplicate some of what you've already done, if so fine. But please verify you've done exactly what is written or know why you shouldn't before proceeding. You may want to print these instructions before continuing.
    To download the current version of Java, go here:
    http://java.sun.com/j2se/1.4.1/download.html
    and click on the word DOWNLOAD in the column labeled SDK in this line:
    Windows (all languages, including English)
    After downloading, click on this page of installation instructions and read through #6:
    http://java.sun.com/j2se/1.4.1/install-windows.html
    NOTE: If you are installing on other than a standard 32-bit Windows system, go to this page
    http://java.sun.com/j2se/1.4.1/install.html and choose the installation instructions for your system.
    Install the software according to the preceeding instructions
    Below is a Helloworld program, copy and paste it into your editor and save it as "HelloWorld.java" Use capitalization, Java is case-sensitive. If you're using Notepad, quote the name when saving, otherwise Notepad adds ".txt" to the name. Go to DOS/command window and check that you've got the file where you want it and that it's named correctly.
    -------program HelloWorld.java--------
    public class HelloWorld {
    public static void main (String[] args) {
    System.out.println("Hello World!");
    In the same directory as HelloWorld.java, enter "javac" - the program should print out a list of options, if not, set your PATH - see below.
    In the same directory as HelloWorld.java, enter "javac HelloWorld.java" and the javac compiler will create HelloWorld.class. If it was successful it will not give any messages. Check that the file is created.
    In the same directory as HelloWorld.java, enter "java -classpath . HelloWorld" with the spaces and the period. The program will run.
    Here is additional information:
    The Windows path is a set of pointers that Windows uses to locate programs that you execute, like javac.exe and java.exe. This setting is explained here:
    http://java.sun.com/j2se/1.4.1/install-windows.html
    Scroll down to: 5. Update the PATH variable
    (you should have already done this as part of the Java installation)
    The CLASSPATH is another set of pointers that is used by Java to find the files that you create and want compiled and/or run. This setting is explained here:
    Setting the Classpath:
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/classpath.html
    [NOTE: always start your classpath with ".;" which means the current directory. See my classpath, below]
    How Classes are Found:
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/findingclasses.html
    Examples:
    This is my path
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.1\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
    This is my classpath
    CLASSPATH=.;C:\mjava;C:\mnrx;C:\NetRexx\lib\NetRexxC.jar;C:\j2sdk1.4.1\lib\tools.jar;C:\NetRexx\NrxRedBk

  • I Can't Get it to compile anything.

    Hi, I can't get it to compile. I'm using Windowsxp Pro and the New beta version of Java jsdk1.4.0-beta3. I set path and my classpath but when I go to compile it gives me this message "error: cannot read: BigDebt.java 1error" Can anyone help me I have been going at it for hours an nothing. Tried everything I can think of need outside help. Thanks

    set your environment variables correctly. You should add your folder (where you store your .java files) in the classpath.
    Try this if it works...
    javac -classpath <mydir> myfile.java
    if this succeeds, you will have to add <mydir> in you classpath.
    Reply if works or not.
    All the best.

  • Can't get Dali Eclipse pluging working

    I want to generate Entities from database tables, using the Dali Eclipse plugin, but I can't get it to work.
    My environment:
    - Eclipse Europa, with Dali 1.0
    - IBM AS400 / DB2 database
    - Using com.ibm.as400.access.AS400JDBCDriver JDBC driver
    I can explore my database via Eclipse's Datasource Explorer, via a database connection I configured, named "test". I configured my project's JPA settings as follows:
    - Platform: Generic
    - Connection: test (same as mentioned above)
    - Discover annotaded classes automatically
    Now when I select JPA Tools > Generate Entities from the context menu, I get the Database Connection selection screen. I can choose my "test" connection here. But whatever I do, the Schema combobox doesn't get populated. And since I cannot select a schema, the "next" or "finish" buttons stay disabled. It doesn't make a difference whether I connect to the database first via the Datasource Explorer or use the "Reconnect" option in the Database Connection selection screen.
    Here's my persistence.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="JPATest">
            <provider>oracle.toplink.essentials.PersistenceProvider</provider>
            <mapping-file>META-INF/orm.xml</mapping-file>
            <properties>
                <property name="toplink.logging.level" value="INFO"/>
                <property name="toplink.target-database" value="DB2"/>
                <property name="toplink.jdbc.driver" value="com.ibm.as400.access.AS400JDBCDriver"/>
                <property name="toplink.jdbc.url" value="jdbc:-----:--------//"/>
                <property name="toplink.jdbc.password" value="----------"/>
                <property name="toplink.jdbc.user" value="---"/>
            </properties>
        </persistence-unit>
    </persistence>I also tried to hand code an Entitiy class and add annotations using Dali. I think the comboboxes in the "JPA Details" panel should be populated from the database, so that I can select a database table and/or column, but that does't happen. I get a lot of "Schema xyz cannot be resolved for table asdf" errors while editing the entity. While this is not the way I want to work (I want to generate Entities from tables) my conclusion is that Dali cannot get a connection to the database at all. That's weird, because the Datasource Explorer can connect to the database.
    I hope someone can give me some hints to resolve this problem.

    Hi Neil,
    Thanks for your suggestion. I thought I tried all combinations of database, catalog and schema names and all different orders to connect, associate the connection and generate entities, but it seems I did not try this one. I did exactly what you suggest, except for the fact that I connected to the database before associating the connection to the project.
    It partially works now. I can generate Entities. Once I have generated an entity, all generated private member variables become red underlined, because table "null" for columns "xyz" could not be resolved. And the drop down box for columns in the JPA Details pane still doesn't get populated. The latter can be fixed by selecting the proper schema for the entity, which results in a @Table(schema="xyz") annotation. However, I expected this to be done automatically when the Entity was generated.
    The error about not being able to resolve the columns still exists. I tried to add a @Column(name="ASDF") annotation (because the columns names are all capital, while the member variables are lowercase), but that doesn't resolve the problem.
    I hope this gives you a clue to solve the problem!
    Bart

  • Can't get my program to compile

    I'm pretty sure I wrote this close to how it should be, but I can't get it to compile. What am I doing wrong?
    File name: TruckTest.java
    This program tests class Truck which has Vehicle as its super class
    Author: Rajan Alex
    import java.util.*;
    public class TruckTest
    public static void main(String[] args){
    Scanner keyboard = new Scanner(System.in);
    String ownerName = "Peggy", brandName = "Volkswagen";
    int towCapacity = 2000, cylinder = 4;
    double loadCapacity = 2.5;
    Truck t1 = new Truck(); // default constructor
    t1.writeOutput(); //default output
    t1.set(ownerName, brandName, cylinder, loadCapacity, towCapacity);
    t1.writeOutput();
    System.out.println("Enter make name:");
    brandName = keyboard.nextLine();
    System.out.println("Enter owner: ");
    ownerName = keyboard.nextLine();
    System.out.println("Enter number of cylinders:");
    cylinder = keyboard.nextInt();
    System.out.println("Enter load capacity:");
    loadCapacity = keyboard.nextDouble();
    System.out.println("Enter tow capacity:");
    towCapacity = keyboard.nextInt();
    t1 = new Truck(ownerName, brandName, cylinder, loadCapacity, towCapacity);
    t1.writeOutput();
    public class Truck extends Vehicle{
    private double load;
    private int tow;
    public Truck()
    load = 0;
    tow = 0;
    public class Truck(String theOwner, String theBrand, int theBanger, double theLoad, int theTow)
    theOwner = super.theOwner();
    theBrand = super.theBrand();
    theBanger = super.theBanger();
    theLoad = super.theLoad();
    theTow = super.theTow();
    public void writeOutput()
    super.writeOuput();
    public void set(String aOwner, String aBrand, int aCylinder, double aLoad, int aTow)
    aOwner = super.aOwner();
    aBrand = super.aBrand();
    aCylinder = super.aCylinder();
    aLoad = super.aLoad();
    aTow = super.aTow();
    public class Vehicle{
    private String manufacturer;
    private int cylinder;
    private String owner;
    public Vehicle(){
    manufacturer = none;
    cylinder = 0;
    owner = 0;
    public class Vehicle(String theOwner, String theBrand, int theBanger)
    owner = theOwner;
    manufacturer = theBrand;
    cylinder = theBanger;
    public void writeOutput()
    super.writeOutput();
    System.out.println("Owner: = " + owner);
    System.out.println("Manufacturer: = " + manufacturer);
    System.out.println("Number of cylinders: = " + cylinder);
    public void set(String aOwner, String aBrand, int aCylinder, double aLoad, int aTow)
    aOwner = super.ownerName();
    aBrand = super.brandName();
    aCylinder = super.cylinder();
    aLoad = super.loadCapacity();
    aTow = super.towCapacity();
    }

        // *not* public class Vehicle
    public Vehicle(String theOwner, String theBrand, int theBanger)I think you mean this to be a constructor, not a class declaration.
    It's a good idea to wrap your code in code tags when you post. As
    Described here: http://forum.java.sun.com/help.jspa?sec=formatting
    Put [code] at the start of your code and [/code] at the end.
    [Edit] You have the same problem with the Truck class.

  • Where can I get a C compiler for Solaris  10 (sparc)?

    Where can I get a C compiler for Solaris 10 (sparc)?

    Have you tried gcc ?Ok. What kind of GCC compiler for Solaris 10( sparc) can you suggest me?
    The gcc-3.3.2 was compiled on Solaris 9, but i am using it on Solaris 10, that is why(it is my assumption) i have some problems with compilation library files( for example, sys/kstat.h)

Maybe you are looking for