示例#1
0
        private static void JarToJson(string jarFilename, string jsonFilename)
        {
            var java = JavaTool.AutoDetect(@"C:\Projects\workspace\jar2json");//C:\Projects\JSharpKit\JarExport");

            java.MaxPermSize = "512M";
            java.ClassPath.Add(@"C:\Projects\workspace\jcorlib\bin\");
            java.ClassPath.AddRange(new string[] {
                @"C:\Users\dkhen\.m2\repository\org\apache\hadoop\hadoop-core\1.0.0\hadoop-core-1.0.0.jar",
                @"C:\Users\dkhen\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar",
                @"C:\Users\dkhen\.m2\repository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar",
                @"C:\Users\dkhen\.m2\repository\commons-httpclient\commons-httpclient\3.0.1\commons-httpclient-3.0.1.jar",
                @"C:\Users\dkhen\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar",
                @"C:\Users\dkhen\.m2\repository\commons-logging\commons-logging\1.0.3\commons-logging-1.0.3.jar",
                @"C:\Users\dkhen\.m2\repository\commons-codec\commons-codec\1.4\commons-codec-1.4.jar",
                @"C:\Users\dkhen\.m2\repository\org\apache\commons\commons-math\2.1\commons-math-2.1.jar",
                @"C:\Users\dkhen\.m2\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar",
                @"C:\Users\dkhen\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar",
                @"C:\Users\dkhen\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar",
                @"C:\Users\dkhen\.m2\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar",
                @"C:\Users\dkhen\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar",
                @"C:\Users\dkhen\.m2\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar",
                @"C:\Users\dkhen\.m2\repository\commons-net\commons-net\1.4.1\commons-net-1.4.1.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\jetty\6.1.26\jetty-6.1.26.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\servlet-api\2.5-20081211\servlet-api-2.5-20081211.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\jetty-util\6.1.26\jetty-util-6.1.26.jar",
                @"C:\Users\dkhen\.m2\repository\tomcat\jasper-runtime\5.5.12\jasper-runtime-5.5.12.jar",
                @"C:\Users\dkhen\.m2\repository\tomcat\jasper-compiler\5.5.12\jasper-compiler-5.5.12.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\jsp-api-2.1\6.1.14\jsp-api-2.1-6.1.14.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\servlet-api-2.5\6.1.14\servlet-api-2.5-6.1.14.jar",
                @"C:\Users\dkhen\.m2\repository\org\mortbay\jetty\jsp-2.1\6.1.14\jsp-2.1-6.1.14.jar",
                @"C:\Users\dkhen\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar",
                @"C:\Users\dkhen\.m2\repository\commons-el\commons-el\1.0\commons-el-1.0.jar",
                @"C:\Users\dkhen\.m2\repository\net\java\dev\jets3t\jets3t\0.7.1\jets3t-0.7.1.jar",
                @"C:\Users\dkhen\.m2\repository\net\sf\kosmosfs\kfs\0.3\kfs-0.3.jar",
                @"C:\Users\dkhen\.m2\repository\hsqldb\hsqldb\1.8.0.10\hsqldb-1.8.0.10.jar",
                @"C:\Users\dkhen\.m2\repository\oro\oro\2.0.8\oro-2.0.8.jar",
                @"C:\Users\dkhen\.m2\repository\org\eclipse\jdt\core\3.1.1\core-3.1.1.jar",
                @"C:\Users\dkhen\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.0.1\jackson-mapper-asl-1.0.1.jar",
                @"C:\Users\dkhen\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.0.1\jackson-core-asl-1.0.1.jar"
            });
            //java.AddAllJarsInDirToClassPath(@"C:\Projects\workspace\jar2json\lib");
            java.Arguments = Quote(jarFilename) + " " + Quote(jsonFilename);
            java.Run();
        }
示例#2
0
 static void Main(string[] args)
 {
     JavaTool.AutoDetect(Directory.GetCurrentDirectory()).Run();
 }