Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

How to execute Jar file using Batch file.

Thread view: 
Sriram - 31 Jan 2008 15:36 GMT
Hello All,

I am new to java.

I used eclipse environment to devlop a java project whic his executing
fine
but i am facing using in batch file execution

I have created a project  under C:\tool\NewTool
Eclipse IDE had folder scr & bin
under which i created a package Pack1 where i had my java files

Batch file content -> jar & bat in same folder (NewTool)
=============
@echo off
cls
Set ClassPath=%ClassPath%; cmdbwc.jar
java  -Xmx200m -cp .src.cmdbwc.cmdbw_main %1 %2 %3 %4 %5 %6 %7

Call & Error
===========
C:\UtilityTool\cmdbwc>java -Xmx200m -cp .src.cmdbwc.cmdbw_main -i "C:
\UtilityToo
l\Deny.log" -d " " -o "C:\UtilityTool\Denyreport.html"
Unrecognized option: -i
Could not create the Java virtual machine.

Please help me out.
TIA,
Sriram.
Lew - 31 Jan 2008 15:59 GMT
> Hello All,
>
[quoted text clipped - 22 lines]
> Unrecognized option: -i
> Could not create the Java virtual machine.

Your classpath is wrong - it's a path, not some weird dot notation thing.

-i is an invalid option, as the message mnost clearly states.  What did you
imagine that it did?

Likewise with -d and -o.

You also need to specify a class with a "public static void main( String []
args)" method in it, which you did not do.

Details are in the Java Tools docs for the 'java' command:
<http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html>

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.