Compile class file, check for code structure quality

now i am trying to develop a system for my college final year project..the main function is to help the lecturer to mark the student java assignment
any way to compile the java file..just to check for the error? if got error then 0 mark..no error got mark..and then check for the code structure and so...base on that ..to decide the student mark..like if good structure 20 mark..bad? 5 mark and so.
is it possible to do so?
Junit?
any sample?

Checking for errors is easy, just write a script to check if javac completed successfully. You can use similar approaches (possibly needing to parse the output) for jlint/PMD/whatever to check code structure. If there's any custom checks you want to do, though, I suggest you grab a parser (possibly witgh semantic analysis; I've found the Eclipse one is rather easily extracted and is good for this stuff) and write manual checks. It might be easier to write PMD rules, but you won't have the flexibility.

Similar Messages

  • Error while De-Compiling class files

    Hi Gurus,
    I am facing one issue.
    While de-compiling class files, Some of the class files are not getting de-compiled correctly. When I open de-compiled Java file, the code is with errors where some of the code lines are not in proper form.
    I have experienced this with couple of times now. I am using JAD as a tool.
    Please help.
    Thanks,
    -Abm

    "Some of the class files are not getting de-compiled correctly. When I open de-compiled Java file, the code is with errors where some of the code lines are not in proper form."
    Well, unless you put a sample of error, how do you expect any solution?--Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • TCode to check for enterprise structure inconsistency

    Hi
    Is there any Tcode to check for enterprise structure inconsistency? I think someone mentioned here but i cannot find it now.

    Hello Deep,
    Please use the T-code --> OVX8N for checking the consistency level of enterprise structure affiliated to SD.
    Here you will have the option to check the organisation unit like Sales orgnisation, Distribution channel, Division, Sales Group, Sales Office, Plant and Shipping Point.
    Regards,
    Sarthak

  • What command would you use to check for allocation, structural, or logical integrity problems?

    What command would you use to check for allocation, structural, or logical integrity problems?

    Wondering if you are looking for DBCC CHECKDB command? For more information, on that command, try to look at this:
    http://technet.microsoft.com/en-us/library/ms176064.aspx

  • Where to find Java Class File Specification for Java 5.0?

    Where to find Java Class File Specification for Java 5.0?
    thank you in advance.

    same place you found it for 1.4Can u give more details? I thought the class spec for Java 1.4 is the same as Java 1.2.
    anyone can tell where to find Java Class File Specification for Java 5.0?
    Thanks.

  • Conversion of class files to source codes

    I was informed that it is possible to convert class files back to the java sourcs codes from where those are generated. How can I protect my source codes from illegal copying by others ?

    hai ,
    yes it is possible to convert class file into source code. there is a software called jad.exe available in the net
    using witch u can convert class file into jar file. but i don't know how to protect the class file to avoid the illigal convertion.

  • How to create common file systems for both development & quality systems

    Hello Team
    Need some calrification & advise
    we are planning to install ECC6 with EHP5 on AIX7.1 with DB2 9.7 version on single physical server ( NO Virutal IP'S) for both development(SID : D10 & System number 20) & quality(SID : Q10 & System number 20) systems.And it will be running in single LPAR for development & quality systems.
    please advise me how can we create the below common file systems for both development & quality to avoid file permission & installation issues.
    /sapmnt/<SID>
    /usr/sap/
    /usr/sap/trans/
    /db2/IBM
    Thanks in advance & Regards
    BM

    Thanks you Juan for your response
    We are planning for seperate DB instance only.
    what could be the owner(UID) & group(GID) for the below file systems
    /sapmnt/
    usr/sap/
    usr/sap/trans
    Thanks in advance
    BM

  • Finding which source is the correct one for a compiled class file

    I have a compiled class (myclass.class) and 3 source files for it (myclass.java). Is there any method, utility, or software that will let me find which source file is the correct one?
    I have about a 100 of these classes which have a lot of copies of the source and we don't know which source is the correct one. The compiled classes are deployed and working and cannot be replaced.
    Thank you for your time!

    Thank you all for your suggestions but..
    1. Recompiling the existing sources and checksum the compiled classes is not a full solution. In addition to finding the version of the compiler that was used and the version of the JDK libraries that were used, I do not know which switches were used when the class was compiled (e.g. -g will output debug info, etc.)
    2. Decompiling: I could not find a good enough decompiler I tried jad which failed with some of the classes; I tries JDec which I did not feel I can fully trust the output (format was less accurate than jad). I tried jode which is limited to java 1.3.
    3. Versioning: our project now is actually to move all the source to Subversion.
    If there is a better decompiler or a way to ensure that a given source file matches the compiled class, please let me know.
    Thanks in advance!

  • Urgent,java Error when compiling class file for jsp

    Hi!
    Reference to statement is ambbiguous,both class java.sql.statement in java.sql and class.java.beans.statement in java beans match.
    this is my file . When i comment the java.import.bean headre it does compile but my server is not able to recognize the class file.,Cud someone help me.
    THis is my source file
    package dbmg;
    //import java.beans.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DbBean
    Connection con;
    ResultSet rs;
    String sql;
    boolean queryType;
    int edited;
    public DbBean() throws Exception
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:Forums");
    public void setQueryType(String s)
    queryType=s.equalsIgnoreCase("select");
    public void setSql(String s)
    sql = s;
    synchronized public void processRequest(HttpServletRequest req) throws
    Exception
    if (queryType)
    Statement stmt=con.createStatement();
    rs=stmt.executeQuery(sql);
    else
    PreparedStatement ps=null;
    ps=con.prepareStatement(sql);
    int count=0;
    String sqlParam,paramValue;
    boolean set=true;
    while (set)
    count++;
    sqlParam="param"+String.valueOf(count);
         if (sqlParam==null)
              set=false;
              continue;
    paramValue=req.getParameter(sqlParam);
         if (paramValue==null)
    set=false;
    continue;
              else
                   paramValue=paramValue.trim();
    try
                   ps.setString(count,paramValue);
              catch(Exception ex)
                   set=false;
                   continue;
    try
    edited=ps.executeUpdate();
    catch(SQLException e)
    edited=0;
    public Connection getConnection()
    return con;
    public ResultSet getResultSet()
    return rs;
    public int stored()
    return edited;
    public void closeCon() throws Exception
    con.close();
    rs = null;

    No need of commenting your import statement. Whenever there is ambiguity, you can use full class name (with package).
    Like,
    java.sql.Statement stmt=con.createStatement();
    Now there is no ambiguity.
    Sudha

  • Running the .class file from java code

    I'm doing a kind of providing service like compiling and running Java code on server side and giving output to the end user.
    Please suggest me an approach with code to run .class file from the Java code.
    import java.io.*;
    public class demo {
    public static void main(String args[]) throws IOException, InterruptedException {
    int result;
    try {
    System.out.println("command output:");
    Process proc = Runtime.getRuntime().exec("java -cp . demoh");
    InputStream in = proc.getInputStream();
    result = proc.waitFor();
    BufferedInputStream buffer = new BufferedInputStream(proc.getInputStream());
    BufferedReader commandOutput = new BufferedReader(new InputStreamReader(buffer));
    String line = null;
    System.out.print(commandOutput);
    try {
    while ((line = commandOutput.readLine()) != null) {
    System.out.print(line);
    System.out.println("command output: " + line);
    }//end while
    commandOutput.close();
    } catch (IOException e) {
    //log and/or handle it
    }//end catc
    } catch (IOException e) {
    System.err.println("IOException raised: " + e.getMessage());
    }

    What happened when you tried what you have there?

  • In PI 7.1 - Java UDF's Compiled Class files - Jar File location

    Hi All,
    In PI 7.1 Does anybody know where the compiled Java UDF's (which are used in Graphical mapping) class files stored in jar are located in integration server? I want to use this jar file in my XSLT mapping.

    Hi,
    I guess it would be under
    \usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\temp\classpath_resolver
    or
    \usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\.\temp\classpath_resolver
    Where SID is your XI instance name.
    Thanks,
    Gujjeti
    Edited by: Praveen Gujjeti on Jun 23, 2008 5:12 PM

  • SDM Prelogin File Check for MAC

    Has anyone had any success using the File Check to search for a file on a MAC PC?  I have been successful scanning anything on the PC side.  I am trying to scan a file location on a MAC which is in the following path/location.
    "/Applications/Sophos\ Anti-Virus.app"
    The prelogon policy is either success or Login Denied.  Of course when testing the login is denied.
    Is there anyone who have dealt with this before or are there any debug commands which I can use to troubleshoot?
    "debug dap trace" doesn't seem to yield what I am trying to see.
    Frank

    Sorry I meant include a "/" etc.!

  • How to convert JSP Compiled class file back to JSP

    Is their any way to convert the JSP converted class file back into JSP file, I have few JSP files missing in my application but i do have class files deployed corresponding to the JSP file. Is their any way where i can convert my JSP class file back to JSP. I tried used decompliers but it conerts the class file into JAVA files, Is their any such decompiler that converts the JSP converted class file into Java files.
    Thanks in Advance.

    nope...its not et al possible...!!!
    You cant convert class file back to JSP....!!

  • Getting the class name from within the compiled class file

    hey!
    I was wondering (i know its possible) how to read a .class and get the name of the class. ok that made not much sense^^ so, You have a file: c:\f.class but it wont run because the file name has to be the same as the classes name, right? so how can you read the class file i guess in binary mode to receive the correct class name.
    I saw inside my f.class i have "realname.java" so i know now that the name of the class file should be realname.class, i tried ways to extract it from the class file but never had any success.
    i think i need to study english^^
    ps: i need this because i have some class files sent to me and the file names have been changed so they wont work, they only work when i open the class file in notepad and find out what its real name should be and then rename the file.
    Edited by: forgotmydamnpass on May 7, 2009 11:23 AM

    ah looks interesting, problem is i cant use it.. im prone to errors!
    import java.net.URLClassLoader;
    public class NewMain {
         * @param args the command line arguments
        public static void main(String[] args) {
            FileClassLoader loader = new FileClassLoader();
            Class clazz = loader.createclass("c:\\f.class");
            Method method = clazz.getName();
    }apparently "createclass" doesnt exist :/
    FileClassLoader = cannot find symbol
    Method = cannot find symbol

  • How do I call a class file in my code?

    Hi,
    I have defined a class, 'WFLTrigger', in a file named WFLTrigger.java. I need to call a method of another class, 'importFile', from within the 'WFLTrigger' class. The 'importFile' class is hard-coded in another file named importFile.java.
    The following is the code snippet I use in the 'WFLTrigger' class to call the 'importFileMethod' method of the 'importFile' class.
    importFile impF = new importFile();
    impF.importFileMethod( clientX, session, "0b0007d58001c142", theFile );
    But, while compiling, I am getting an error:
    cannot find symbol.
    symbol : method importFile()
    location: class WFLtrigger
    importFile( clientX, session, "0b0007d58001c142", theFile );
    1 error
    Can anybody help me out here as to what is going wrong?
    Thanks,
    Arun

    Hi Paul,
    Thanks for the reply. In fact, I initially had the line of code:
    importFile( clientX, session, "0b0007d58001c142", theFile );
    Then I changed it to the snippet that I posted. I am using NetBeans 4.0 IDE on Windows 2000 SP4 OS.
    I am posting my entire code below:
    import com.documentum.fc.client.*;
    import com.documentum.fc.common.*;
    import com.documentum.com.*;
    import com.documentum.operations.*;
    import com.documentum.fc.client.IDfSysObject;
    import com.documentum.fc.client.IDfType;
    import com.documentum.fc.common.DfId;
    import java.util.* ;
    import java.lang.Integer;
    public class WFLtrigger
    public WFLtrigger(String[] args)
    IDfClientX clientX = new DfClientX();
    IDfClient client = DfClient.getLocalClient();
    IDfSessionManager sMgr = client.newSessionManager();
    IDfLoginInfo loginInfo = new DfLoginInfo();
    loginInfo.setUser("abc");
    loginInfo.setPassword("xyz");
    loginInfo.setDomain("");
    sMgr.setIdentity( "pqr", loginInfo );
    IDfSession session = sMgr.getSession( "pqr" );
    IDfFile theFile = clientX.getFile( "C:\\wet" );
    importFile impF = new importFile();
    impF.importFileMethod( clientX, session, "0b0007d58001c142", theFile );
    NetBeans does not compile it. It gives an error as stated in the post above at the 2nd last line.
    I appreciate any help on this.
    Thanks,
    Arun

Maybe you are looking for

  • How can i hide a portion of the text inside a spry dataset "stackedcolumn"?

    Hi all I have a spry dataset set up reading a .xml file for the price/name/description/etc. I want to only show some of the text (a certain number of characters) at the start then give the visitor the option of clicking a toggle button to see more of

  • DOCTYPE is optional, why UCCX still issues Error in logs?

    We have a vxml server pointed by UCCX voice browser. I tested a simple vxml app. then found this error in logs. I believe in UCCX technic docs, it says the DOCTYPE is optional, why it still complains it? 129984: Feb 15 11:10:39.691 EST %MIVR-SS_VB-7-

  • SwingX JXTreeTable and Tooltips

    Hello I have what I think is a small bug in JXTreeTable. Using the attached self contained runnable example and the SwingX 1.6.4 library do the following 1. Hold mouse over any cell and the tooltip is displayed 2. Click the tree icon so the tree coll

  • When downloading 6.0, will it overwrite 5.5?

    I have Creative Suite 5.5 Design Premium installed on my computer, I want to keep that version. I am about to download 6.0 "Creative Cloud for teams" and I was wondering if the 6.0 version will create a seperate new copy and preserve the 5.5 version

  • Can OATS scripts that are created on Windows version run on a LINUX version

    Can ATS scripts that were recorded/ created on Windows version of ATS be ported to a LINUX version of ATS and run successfully. Do both versions of ATS need to be identical? we are using version internal Windows build version 9.31.0029 and the LINUX