Compiling a class, help.

I am having trouble compiling a class file on my server. I have been given the path for the Java Compiler but I am so new to telnetting and unix.
The path that I have been given is usr/local/java/bin/ to use the Java Compiler. I have tried a lot of different strings, but I can't seem to get it to work.
This is the code that I want to use: usr/local/java/bin/javac -classpath %CLASSPATH%;C:/usr251/home/obetz/public_html/servlets/mail.jar
Does that look write? What is the string I want to use when I telnet into my account if I want to compile my java file into a class?

Please bear with me. I'm really new to Unix. I've got a couple of jar & java files already in the classpath. Here is where they are:
/usr251/home/obetz/public_html/servlets/
MailerBean.java and mail.jar
This is what i tried to use to compile the mail.jar file:
/usr/local/java/bin/javac /usr251/home/obetz/public_html/servlets/mail.jar
The error is invalid option or arguement. I also tried it with -classpath in the middle, omitting the $CLASSPATH and still nothing.

Similar Messages

  • Help compiling with .class files

    I am using JGrasp and I am trying to compile a program that uses .class files instead of the .java files, but JGrasp will not recognize these at compile time. How do I get my program to compile with these .class files?

    I prefer using Jenuity:
    [http://www.nmmu.ac.za/jenuityIDE]
    It's much simpler to use than JGrasp and isn't nearly as confusing.
    For the record, you compile .java files into .class files. There is no need to "compile" existing .class files. If you have the class files you can run them from the command line. e.g. if you have a class file named Orange.class you should be able to type "java Orange" from the command line to run it. If Orange is inside a directory structure based on packages you may need to execute this command from just outside the 'highest" folder.
    If you just need to link to these class files, copy them into the "/jre/lib/ext" folder of your JDK.

  • Compile Error: 'class' or 'interface' expected

    Hi all,
    I have a code which was compiling/running successfully:
    import java.net.*;
    code
    When I added the line: import java.io.*;
    import java.net.*;
    import java.io.*;
    code
    Got the following compile error:
    'class' or 'interface' expected
    import java.io.*;
    ^
    If I comment one of my import statements then it compiles, but I can't have both!
    Does anybody know what's the problem? where it comes from?
    Any help is greatly appreciated.

    I haven't post the entire code b/c it's very long, anyway here it is...
    import java.net.*; ;
    import java.io.*;
    //class TransactionOp: #1
    class TransactionOp
    int ID = 0;
    double price = 0.0;
    int subsID = 0;
    String xmlDoc = "";
    String xmlResp = "";
    String respID = "";
    String authCode = "";
    int opResult = 0;
    public TransactionOp(int anID, double aPrice, int aSubID)
         ID = anID;
         price = aPrice;
         subsID = aSubID;     
         //op done values: 1: REF, 2: DCL, 3: AUTH, 4: AUTH_NoID
         //op errors: -1: noResponse, -2: noAuthResp, -3: noStatus, -4: no gw.
    //class AddressCC: #2
    class AddressCC
    String zipcode = "";
    String city = "";
    String state = "";
    String country = "";
    String address1 = "";
    public AddressCC(String addr1, String city1, String state1, String country1, String zipcode1)
         address1 = addr1;
         city = city1;
         state = state1;
         country = country1;
         zipcode = zipcode1;
    //class InfoCC: #3
    class InfoCC
    String fullName = "";
    String number = "";
    String expDate = "";
    public InfoCC(String name, String number1, String date)
         fullName = name;
         number = number1;
         expDate = date;
    public class SurePayGW
    //instance fields
    private String merchant = "";//merchant = aMode
    private String password = "";
    private String server = "";
    private int subsID = 0;
    public SurePayGW()
         merchant = "34593";
         password = "hnbv78hj6";
         server = "xml.surepay.com";     
    }//endof constructor:SurePayGW
    //String formattedS = "\"" + s + "\"";
    public void spitDoc(SurePayGW sp, AddressCC address, InfoCC ccInfo, TransactionOp trans)
         String xmlBuf = "<!DOCTYPE pp.request PUBLIC \"-//IMALL//DTD PUREPAYMENTS 1.0//EN\" \"http://www.purepayments.com/dtd/purepayments.dtd\">";     
         xmlBuf = xmlBuf + "<pp.request merchant=" + "\"" + sp.merchant+ "\" password=" + "\"" + sp.password+ "\">";
         xmlBuf = xmlBuf + "<pp.auth ecommerce=\"true\" ordernumber=" + "\"" + trans.ID + "\" recurring=\"false\">";     
         xmlBuf = xmlBuf + "<pp.creditcard number=" + "\"" + ccInfo.number + "\" expiration=" + "\"" + ccInfo.expDate.charAt(0) + ccInfo.expDate.charAt(1)+ "/" + ccInfo.expDate.charAt(2) + ccInfo.expDate.charAt(3) + "\">";          
         xmlBuf = xmlBuf + "<pp.address type=\"billing\" zip=" + "\"" + address.zipcode + "\" city=" + "\"" + address.city + "\" state=" + "\"" + address.state + "\" country=" + "\"" + address.country + "\" fullname=" + "\"" + ccInfo.fullName + "\" address1=" + "\"" + address.address1 + "\"/>";
         xmlBuf = xmlBuf + "</pp.creditcard>";     
         xmlBuf = xmlBuf + "<pp.address type=\"shipping\" zip=" + "\"" + address.zipcode + "\" city=" + "\"" + address.city + "\" state=" + "\"" + address.state + "\" country=" + "\"" + address.country + "\" fullname=" + "\"" + ccInfo.fullName + "\" address1=" + "\"" + address.address1 + "\"/>";     
         xmlBuf = xmlBuf + "<pp.lineitem sku=\"R" + trans.subsID + "Zg\" description=\"Subscription Renewal\" taxrate=\"0\" quantity=\"1\" unitprice=\"" + trans.price + "USD\"/>";
         xmlBuf = xmlBuf + "</pp.auth></pp.request>";
         //print("@DBG [SurePayDoc.submitTransaction]: will send %s" % xmlBuf)
         trans.xmlDoc= xmlBuf;
         //System.out.println("This the final result of xmlBuf: ");
         //System.out.println(xmlBuf);
         //System.out.println("trans.xmlDoc = " + trans.xmlDoc);
    }//endof m: spitDoc
    public void submitTransaction(SurePayGW sp, TransactionOp aTrans)
         String param = "";
         HttpURLConnection connection;
         URL url;
         String urlString = "";
         String input = "";
         String response = "";
         try
              //params= urllib.urlencode({'xml' : aTrans.xmlDoc})
              param = java.net.URLEncoder.encode(aTrans.xmlDoc, "UTF-8");
              //System.out.println("The output from java.net.URLEncoder.encode: " + param);
              //link= httplib.HTTPSConnection(self.server)
              urlString = "https://" + sp.server;
              url = new URL(urlString);
              connection = (HttpURLConnection)url.openConnection();          
              System.out.println(connection.getURL());          
              System.out.println(connection.getResponseCode() + " " + connection.getResponseMessage());          
              System.out.println(connection.getURL());
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              //link.putrequest('POST', '/')
         connection.setRequestMethod("POST");
              //link.putheader('Content-type', 'application/x-www-form-urlencoded')
              //link.putheader('Content-length', ("%d" % len(params)))
              //link.putheader('Accept', 'text/plain')
              connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
              connection.setRequestProperty("Content-length", param.length());
              connection.setRequestProperty("Accept", "text/plain");
              //link.endheaders()
              connection.connect();
              System.out.println("Client : Connected");
              //link.send(params)
              //response= link.getresponse()
              //data= response.read()     
              DataOutputStream out = new DataOutputStream(connection.getOutputStream());
              System.out.println("Client : Writing Content");
              out.writeBytes(content);
              System.out.println("Client : Flushing Stream");
              out.flush();
              System.out.println("Client : Waiting for response from Server");
              BufferedReader in = new BufferedReader(new InputStreamReader(http.getInputStream()));
              System.out.println("Client : Opened input stream");
              while((input = in.readLine()) != null)
                   response += input + "\r";
              System.out.println("Client : received : "+response);
              //I'm not bothering to close the streams or http connection yet.
         }//endof: try
         catch (MalformedURLException e)
              e.printStackTrace();
         catch (Exception e)
              e.printStackTrace();
    }//endof m:submitTransaction
    }//endof class:SurePayGW

  • How to re-compile the class after modification??

    Hello All,
    I found that in 'SearchResourceRenderer' Target window is hardcoded as "_blank". Now i have changed that to "_self" so that i can open the documents from the Search Results in the same frame.
    Please help me in re-compiling the class so that i can deploy it again onto the Portal.
    Regards
    Vaib

    Hi Vaib,
    as already told in the parallel thread:
    - Put the decompiled, changed class into a NWDS Java project.
    - Install and use ClassLocator to create the complete build path needed.
    - After the class doesn't show any more errors, it's compiled. Open the original JAR within the portal app directory with a hot replacement tool like WinRAR and drag and drop the class file into the JAR folder. Restart the server.
    The alternative is to import the whole PAR,  additionally to put the JARs into the PAR project, remove the class from the JAR where it comes from, recompile the changed decompiled class and then deploy the complete PAR into the portal. It's a bit more work but a more clean deployment.
    Hope it helps
    Detlev

  • Compiling dependent classes

    I have three classes that are dependent on each other, that is class 1 utilizes objects of type class 2 and class 3, class 2 utilizes objects of type class 1 and class 3, and class 3 utilizes objects of type 1 and 2. I am wondering how to compile these classes. I know for the same situation in C++ this conflict is resloved through header files, since there is no header files in Java I am assuming there is compiler flag I can set, I tried the -soucepath flag but that doesn't seem to work. Any suggestions, I know I might be able to accomplish my goal using interfaces or abstract classes but I would really like to avoid using those. Any help would be appreciated.
    Thanks

    -sourcepath I believe should do it. What error message(s) did you get?
    But another approach is just to specify all three classes as arguments to javac, as in:
    javac Class1.java Class2.java Class3.java

  • Ant or what tool to compile Java Classes

    For the past year I have been using Windows command window to compile Java Classes for my Servlets, Java Beans and Helper classes. I use Cold Fusion studio as my IDE for creating the Java classes. All of my Web Applications use MVC for Forms feeding small databases and I only have around 7 to 10 class files per Web application.
    Should I start to use Ant and/or what is recommended so I can keep up with current technology instead of using Windows Command Window to compile my Java classes?

    Try the following link.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/cfc19866-0401-0010-35b2-dc8158247fb6
    The download in the above link has NWDS and portal as well. Unzip the file and install NWDS studio.

  • Unable to compile java classes in NWDS- "JSPDynPage cannot be resolved "

    Hi All,
    I am trying to write small JSPDynaPage when i am getting following complilation error in my Java classess.
    1) "PageProcessorComponent cannot be resolved or is not a valid superclass"
    2) "JSPDynPage cannot be resolved or is not a valid superclass"
    I did check for the existance of
    com.sap.portal.htmlbbridge.jar & prtapi.jar which is present in my C:\NetWeaverDevStudio\eclipse\plugins\com.sap.ep.applicationDevelopment and
    ECLIPSE_HOME=C:/NetWeaverDevStudio/eclipse but for some reason i am unable to compile my classes. Please help me to resolve this issue.
    Thanks,
    Manju

    Try the following link.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/cfc19866-0401-0010-35b2-dc8158247fb6
    The download in the above link has NWDS and portal as well. Unzip the file and install NWDS studio.

  • Compile Error : Need help!

    Hi All,
    I try to compile 2 java files
    File1: theModel.java
    package beans;
    public class theModel
      public String setMsg()
        {return "Test programe"}
       public theModel()
      }it was not error when i compiled this file :
    c:\>javac -d tomcat\webapps\Test\WEB-INF\classes
    Arunya\bean\theModel.java
    after compiled theModel.class stored in
    C:\tomcat\webapps\Test\WEB-INF\classes\beans\theModel.class
    File2: theController.java
    import beans.theModel;
    import java.io.*;
    import javax.servlet.*;
    public class theController extends HttpServlet
    String target = "theView.jsp"
    theModel model = new theModel();
    public void doGet(HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException,
    java.io.IOException
    req.setAttribute("message",model.setMsg);
    RequestDispatcher dispatcher =
    req.getRequestDispatcher(target);
    dispatcher.forward(req,res)
    }and I had a problem with this file becuase when i compiled, it had a error :
    package beans does not exits
    this is how I compiled
    c:\javac Arunya\Servlet\theController.java
    also I try this way
    c:\set classpath = c:\tomcat\webapps\Test\WEB-INF\classes
    c:\> javac Arunya\Servlet\theController.java
    but both of them had the error same
    This is my Enviroment Variables(System variable)
    CLASSPATH : C:\tomcat\commond\lib\Servlet-api.jar;
    C:\tomcat\commond\lib\jsp-api.jar;
    CATALINA_HOME : C:\tomcat
    JAVA_HOME: C:\Program Files\Java\jdk1.5.0_06
    PATH : C:\tomcat\bin;C:\Program Files\Java\jdk1.5.0_06\bin
    can you help me?
    Thank
    Arunya

    You missed semi colons (;) here and there
    sorry , don't notice this because when I wrote the code to post I forgot (;) at
    {return "Test programe"};
    String target = "theView.jsp";
    dispatcher.forward(req,res);
    but in my real code i didn't miss semi colons ,
    The problem that i want to solve is[i] I can not import package beans
    error: package beans does not exitspackage beans does not exits
    thank

  • Can't compile custom classes in Release 12 environment.

    Hi ,
    We have some extensions to the OA Framework pages in Oracle Applications. The custom java files for the same are returning the following error while compiling in the release 12 environment.
    RufiReviewSubmitCO.java:78: cannot access oracle.sql.NUMBER
    bad class file: /u002/app/applmgr/R12TSTcomn/java/lib/appsborg.zip(oracle/sql/NUMBER.class)
    class file has wrong version 50.0, should be 49.0
    The same java files works without issues in a 11.5.10cu2 environment.
    The java version on the server is 1.6.0_10 and the java file was created on a client machine with java 1.6 version.
    Have you encountered this error, how to overcome this. Any help is appreciated.
    Thanks
    Sudeep

    hi
    it seems that u direct compiling the files in unix box ,one other way i can suggest , if u will compile the class using Jdeveloper compatible to your EBS and then move the file to server ,definietly it will work.Note:416708.1 on Metalink has a list of all the JDev patches for the various releases of Oracle Applications.
    thanx
    Pratap

  • Dynamically Create and Compile Java Classes

    Hi,
    I have a requirement to dynamically create and compile Java classes and would like some advice on the best method to do so.
    Basically the project I am working on involves creating "Factors". Factors are items that have both attributes and weights so for example Factor A could have attribute B with weight 0.76, and attribute C with weight 1.33. There are a number of methods common to all factors such as calculateTotal, identify etc etc.
    At the moment the application has 5 factors, but there is a requirement to dynamically add and remove factors on the fly.
    I current solution I have been considering is using XML to describe the new class, build up the class and compile it; something along the lines of what is descibed at
    http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-xslt_p.html
    however i would like to consider all options.
    Any help with this is greatly appreciated.

    You want to dynamically create and compile Java classes.
    I would try the following:
    (1) Write the Source code of the new class into a text file with the name MyNewClass.java
    (2) compile this new .java-file with Runtime r = getRuntime();
    try {
        r.exec ("javac MyNewClass.java");
    } catch (IOException e) {
        System.out.println("ooops " + e.getMessage());
    } (3) somehow try to load that new class, maybe using ClassLoader cl = ClassLoader.getSystemClassLoader();
    cl.loadClass("MyNewClass");

  • Compiling Nested Classes and Interfaces

    I am looking for documentation about compiling nested classes and interfaces. I have found something in the JVM Specification, but there does not explain how a nested class is compiled and what is included in the top level class to mark a "place holder" to the nested class. The JVM Specification in this topic cite the web page http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc.html that does not exists any more.
    My root problem is that: I am compiling a class with a private nested class, but in the class file generated TopLevelClass$NestedClass.class the class does not have the private modifier. So I am not understanding why the "private" modifier was removed during compilation.
    I performed the same test with a protected nested class and the result was the nested class with the public modifier. So I am not understanding why the "protected" modifier was changed to "public".
    Thanks in advance,
    Mardoqueu.

    This should not be happening. What compiler are you using? If it's a reasonably recent Sun compiler, could you post a minimal example?

  • Cannot compile two classes that are on same package

    When I compile two classes that are on same package one class that is independent of other class gets compiled but the other class which uses
    the first one shows cannot find symbol error with the first class name

    try...
    javac *.java
    that should compile all the java files in that folder at the same time. I dont know if that will fix your problem but it is worth a shot.

  • Java.lang symbols not found when compiling package classes

    I have a set of classes that I have wrapped up in a package. The package name and
    directory structure follow the standard required for each. These classes contain many
    java.lang.Math functions and java.lang.Double calls.
    Am I correct in that the java.lang functions will be imported automatically? When I
    compile a class that is in the package, it looks for the Math.pow (for example)
    function in the package instead of java.lang. I have tried putting the following include
    at the top:
    include java.lang.*;and I still get the "cannot resolve symbol" error. Only when I use
    include java.lang.Math;
    include java.lang.Double;does it compile properly. Is this indicative of a problem with my classpath? It is
    currently set to look in whatever the current directory is, the directory with src.jar,
    and my dev directory that contains the package I am working on.
    Please advise! Thanks in advance!
    Rodman

    Thanks for the quick reply! I looked in the package directory and found the Math.java and
    Double.java files. I'm not sure why they were there. Thanks again!

  • Suffering an complie error when trying to compile java class in EBS11i

    Hi,
    When I trying to compile java classes with which imported the HttpServletResponse class, will get the follow error message:
    package javax.servlet does not exist
    cannot resolve symbol
    symbol : class HttpServletResponse
    It seems the javax.servlet package is not included in the classpath. But I checked the $CLASSPATH, it seems no problem.
    echo $CLASSPATH
    /u02/applvis/viscomn/util/java/1.4/j2sdk1.4.2_04/lib/tools.jar:/u02/applvis/viscomn/util/java/1.4/j2sdk1.4.2_04/lib/dt.jar:/u02/applvis/viscomn/util/java/1.4/j2sdk1.4.2_04/jre/lib/charsets.jar:/u02/applvis/viscomn/util/java/1.4/j2sdk1.4.2_04/jre/lib/rt.jar:/u02/applvis/viscomn/java/appsborg2.zip:/u02/applvis/visora/8.0.6/forms60/java:/u02/applvis/viscomn/java
    Does anyone know the reason?
    environment: ebs 11i
    Thanks&Regards,
    Xiaofeng

    resolved this issue.
    1. Edit $APPL_TOP/admin/adovars.env file -
    Add the following jar files to the AF_CLASSPATH line -
    Full path of /...../iAS/Apache/Jsdk/lib/jsdk.jar
    Full path of /...../iAS/Apache/Jserv/libexec/ApacheJServ.jar
    2. Bounce the concurrent manager in order to have the changes take effect.

  • Compiling Java Class in Workshop

    May I ask a dumm question: how to compile a java class in Workshop? Application
    Build or Project Build does not seem to do the work.
    Thanks.

    "Gerald Nunn" <[email protected]> wrote:
    "Jeff" <[email protected]> wrote in message
    news:406455b2$[email protected]..
    May I ask a dumm question: how to compile a java class in Workshop?Application
    Build or Project Build does not seem to do the work.Works fine for me, what type of project is the java file in?
    Gerald
    Thanks for the reply.
    It is a web project. My Java files are under the following folder tree:
    eSheetWeb\WEB-INF\classes
    I have run Build Project against eSheetWeb few times. No errors but java files
    just not getting compiled to class. Also is there a way to just compile without
    run the entire Build?

Maybe you are looking for

  • Custom Error Messages in Sourcing Cockpit do not prevent PO creation

    Hi forum gurus, We are implementing SRM 5.5 SP 9 in extended classic mode. We have implemented sourcing cockpit too. We have coded an error message in the 'BBP_ITEM_CHECK' BADI for the sourcing cockpit and it appears correctly in the sourcing cockpit

  • Entity OnPropertyChanged don't refresh UI binding

    Using RIA Services Entity Framework through Silverlight I surprised when the UI not being updated: I have a simple Entity created through webservices edmx which contains on generated code all the stuff to notify that property of the entity changed; s

  • How to download & convert .f4f video streaming files into flv/mp4 files

    Below is the website for which I am asking this query http://www.startv.in/show/devon-ke-dev-mahadev/352 These are .f4f videos which I can view online. I am not able to download & play them in their original format. I also would like to download & pl

  • Slow after 10.6 upgrade

    My wife has a macbook ver 2,1 1GB ram. I have recently re-patition the HD and upgrade to 10.6. After the upgrade, she is now complaining it is going slower then when having 10.4. My question is what should I do? Will increase to like 4GB ram help? Or

  • CS5 still no Tivo support - uggg!

    W ith almost every other package offering support, from freeware to the leading competitors, why on Earth can't Adobe get it together and provide Tivo file support. This is such a pain to have to load in another program, output to mpeg, then go thru