java - Main method not found in class/illegal start of expression -



java - Main method not found in class/illegal start of expression -

i new of , have basic understanding of coding in general.

i trying utilize java code published in chemmedchem (dx.doi.org/10.1002/cmdc.200900317 in supporting information)

i have appropriate programs/jar files utilize (from chemaxon)

i able re-create code , compile class file no issues:

javac -classpath c:\jarfolder\marvinbeans-plugin.jar;c:\jarfolder\marvinbeans.jar; mqn.java

though get:

note: mqn.java uses or overrides deprecated api. note: recompile -xlint:deprecation details.

then when seek run class file (the input file supposed virtual chemical input smiles code):

java -classpath c:\jarfolder\marvinbeans-plugin.jar;c:\jarfolder\marvinbeans.jar; mqn test.smiles

i get:

error: main method not found in class mqn, please define main method as: public static void main(string[] args)

i tried enclose code in

public static void main(string[] args){}

however error:

>mqn.java:10: error: illegal start of look public string calculatemqn(molecule m) { ^ >mqn.java:10: error: ';' expected public string calculatemqn(molecule m) { ^ >mqn.java:10: error: ';' expected public string calculatemqn(molecule m) { ^ >mqn.java:255: error: reached end of file while parsing } ^ 4 errors

below find code used (before adding public static void main(string[] args)), help much appreciated

thanks!

java code:

import chemaxon.calculations.topologyanalyser; import chemaxon.marvin.calculations.hbdaplugin; import chemaxon.struc.molatom; import chemaxon.struc.molbond; import chemaxon.struc.molecule; public class mqn { topologyanalyser ta = new topologyanalyser(); hbdaplugin hbda = new hbdaplugin(); public string calculatemqn(molecule m) { if (!m.dearomatize()) { system.out.println("dearomatize error"); } ta.setmolecule(m); //classic descriptors seek { hbda.setmolecule(m); hbda.run(); } grab (exception e) { system.err.println("hbda error"); } int hbd = hbda.getdonoratomcount(); int hbdm = hbda.getdonorcount(); int hba = hbda.getacceptoratomcount(); int hbam = hbda.getacceptorcount(); /*reymond style rot bond count*/ int rbc = ta.rotatablebondcount(); (int = 0; < m.getbondcount(); i++) { if (m.getbond(i).gettype() == 3) { rbc--; } } if (rbc < 0) { rbc = 0; } //ring properties / ring sizes count int r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0, r9 = 0, rg10 = 0; int[][] sssr = m.getsssr(); (int = 0; < sssr.length; i++) { switch (sssr[i].length) { case 3: r3++; break; case 4: r4++; break; case 5: r5++; break; case 6: r6++; break; case 7: r7++; break; case 8: r8++; break; case 9: r9++; break; default: rg10++; break; } } //atom properties int c = 0, f = 0, cl = 0, br = 0, = 0, thac = 0, asv = 0, adv = 0, atv = 0, aqv = 0, cdv = 0, ctv = 0, cqv = 0, p = 0, s = 0, posc = 0, negc = 0, afrc = 0, cn = 0, = 0, co = 0, ao = 0; (int = 0; < m.getatomcount(); i++) { molatom @ = m.getatom(i); boolean isringat = ta.isringatom(i); if (at.getatno() != 1) { thac++; } //element counts switch (at.getatno()) { case 1: case 2: case 3: case 4: case 5: break; case 6: c++; break; case 7: if (isringat) { cn++; } else { an++; } break; case 8: if (isringat) { co++; } else { ao++; } break; case 15: p++; break; case 16: s++; break; case 9: f++; break; case 17: cl++; break; case 35: br++; break; case 53: i++; break; } //valency count switch (at.getbondcount()) { case 0: system.out.println("atom no bonds"); break; case 1: asv++; //single valent can acyclic break; case 2: if (isringat) { cdv++; } else { adv++; } break; case 3: if (isringat) { ctv++; } else { atv++; } break; case 4: if (isringat) { cqv++; } else { aqv++; } break; } if (ta.ringcountofatom(i) > 1) { afrc++; } } //bond properties int csb = 0, cdb = 0, ctb = 0, asb = 0, adb = 0, atb = 0, bfrc = 0; (int = 0; < m.getbondcount(); i++) { molbond bd = m.getbond(i); if (ta.isringbond(i)) { switch (bd.gettype()) { case 1: csb++; break; case 2: cdb++; break; case 3: ctb++; break; default: system.out.println("unknown cyclic bond type " + bd.gettype()); break; } } else { switch (bd.gettype()) { case 1: asb++; break; case 2: adb++; break; case 3: atb++; break; default: system.out.println("unknown acyclic bond type " + bd.gettype()); break; } } } //bond's fused ring count int[][] sssre = m.getsssrbonds(); int[] brc = new int[m.getbondcount()]; (int j = 0; j < sssre.length; j++) { (int k = 0; k < sssre[j].length; k++) { brc[sssre[j][k]]++; } } (int j = 0; j < brc.length; j++) { if (brc[j] > 1) { //if bond's ring count > 1 bfrc++; //increase fused ring bonds count } } (int = 0; < m.getatomcount(); i++) { int crg = m.getatom(i).getcharge(); if (crg > 0) { posc += crg; } if (crg < 0) { negc += math.abs(crg); } } homecoming //classic properties hbd + ";" //hydrogen bond donor atom count 1 + hbdm + ";" //hbd multivalency 2 + hba + ";" //hydrogen bond acceptor atom count 3 + hbam + ";" //hba multivalency 4 + rbc + ";" //rotatable bond count 5 //ring properties + r3 + ";" + r4 + ";" + r5 + ";" + r6 + ";" + r7 + ";" + r8 + ";" + r9 + ";" + rg10 + ";" //ringsize counts 6-13 //atom properties + thac + ";"//total heavy atom count (= else h d t) 14 + c + ";" //carbon count 15 + p + ";"//phosphorus 16 + s + ";"//sulfur atom count 17 + f + ";" //fluor atom count 18 + cl + ";" //chlorine atom count 19 + br + ";" //bromine atom count 20 + + ";" //iodine atom count 21 + cn + ";" //cyclic nitrogen count 22 + + ";" //acyclic nitrogen count 23 + co + ";" //cyclic oxygen count 24 + ao + ";" //acyclic oxygen count 25 + asv + ";"//acyclic single valent atom count 26 + adv + ";"//acyclic double valent atom count 27 + atv + ";"//acyclic triple valent atom count 28 + aqv + ";"//acyclic quart valent atom count 29 + cdv + ";"//cyclic double valent atom count 30 + ctv + ";"//cyclic triple valent atom count 31 + cqv + ";"//cyclic quart valent atom count 32 + afrc + ";"//atoms-in-fused-ring count 33 + posc + ";" // positive charges 34 + negc + ";" // negative charges 35 //bond properties + csb + ";"//cyclic single bonds 36 + cdb + ";"//cyclic double bonds 37 + ctb + ";"//cyclic triple bonds 38 + asb + ";"//acyclic singe bonds 39 + adb + ";"//acyclic double bonds 40 + atb + ";"//acyclic triple bonds 41 + bfrc + ";"//bonds-in-fused-ring count 42 + m.toformat("smiles:q");//end 43 } }

add main

............................... ............................... public class mqn { topologyanalyser ta = new topologyanalyser(); hbdaplugin hbda = new hbdaplugin(); public static void main(string [] args) { // execution of programme begin } public string calculatemqn(molecule m) { if (!m.dearomatize()) { system.out.println("dearomatize error"); ............. ..............

post comment here if still compiler errors

java class methods main

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -