Skip to content

Commit

Permalink
fix bugs: argc is dirferent from c++ in java
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagewang committed Jun 11, 2012
1 parent 7bf878e commit 148ecb8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

public class HelloWorld {
public static void main(String[] args) {
int i = 0;
for (String arg : args) {
System.out.println("arg[" + i++ + "] = " + arg);
}
System.out.println("Hello World!");
System.exit(0);
}
Expand Down
Binary file added snapshot/20120611/jwrapper.exe
Binary file not shown.
31 changes: 31 additions & 0 deletions snapshot/20120611/jwrapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<java>
<debug>false</debug>

<javahome>${JAVA_HOME}</javahome>

<jvmtype>client</jvmtype>

<mainclass>com.github.vintage.wang.jwrapper.sample.HelloWorld</mainclass>

<properties>
<java.ext.dirs>${cpd}/../lib</java.ext.dirs>
<com.sun.management.jmxremote></com.sun.management.jmxremote>
<com.sun.management.jmxremote.port>9999</com.sun.management.jmxremote.port>
<com.sun.management.jmxremote.authenticate>false</com.sun.management.jmxremote.authenticate>
<com.sun.management.jmxremote.ssl>false</com.sun.management.jmxremote.ssl>
<log4j.configuration>${cpd}/log4j.properties</log4j.configuration>
</properties>

<classpaths>
<path>${cpd}/../samples/Hello/target/Hello-1.0-SNAPSHOT.jar</path>
</classpaths>

<options>
<-Xms512m></-Xms512m>
<-Xmx512m></-Xmx512m>
<-XX:NewSize>256M</-XX:NewSize>
<-XX:MaxNewSize>256M</-XX:MaxNewSize>
<-XX:PermSize>128M</-XX:PermSize>
<-XX:MaxPermSize>128M</-XX:MaxPermSize>
</options>
</java>
2 changes: 1 addition & 1 deletion src/jwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int argc, char** argv)
if(result) {
JavaConfig::getInstance()->printAll();

return JavaLauncher::getInstance()->launchJavaApp(argc, argv);
return JavaLauncher::getInstance()->launchJavaApp(argc - 1, ++argv);
}

return -1;
Expand Down

0 comments on commit 148ecb8

Please sign in to comment.