English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I wrote a Java program using J creator and Easyinput, I have 2 .class files and 2 .java files. How do i launch it externally so i don't have to open J creator every time i want to run it?

2007-08-15 14:03:23 · 2 answers · asked by Digital Hazard 2 in Computers & Internet Programming & Design

2 answers

ok.. make batch file. Inside batch file you should be as like below..

This is example from my program:

Step 1: Writing command as below
setlocal
set JAVA_HOME=C:\jdk1.3.1_04
set PATH=C:\jdk1.3.1_04\bin

c:
ECHO Data Tranfer ver1.0
ECHO Copyright (C) 2007
ECHO startup running...
%JAVA_HOME%\jre\bin\java -Xms64M -Xmx128M -jar DataTransfer.jar -userThreads
ECHO startup stopping...
endlocal

Step 2 : save as .bat
Step 3: just click at .bat and the program will running.

note : I cluster all my .class into jar file. you can modified command above to run in class.

further information : http://www.sun.com

2007-08-15 14:35:54 · answer #1 · answered by richman 1 · 0 0

You can use the "java" command to run it. If you implemented the classes in the default package, you'd just go to the directory where the classes are and execute:

java -cp . MyClass1

If the "java" command isn't found, you need to add the Java runtime bin directory to your %PATH%.

2007-08-16 00:19:27 · answer #2 · answered by McFate 7 · 0 0

fedest.com, questions and answers