How to compile Java
We all know Java compiles down into byte format which requires a JVM to run. Often for deployment we can not guarantee that our clients will have the JRE installed, nore can we supply them with a jar file. What solutions do people use to compile their Java code into native code for simple use and execution?
|
You can try this http://gcc.gnu.org/java/
|
You need jdk to compile java application
|
In JDK, open DOS and type..
javac filename.java and to run/execute the file type- java filename |
You must to share path to your client.They are same path in their pc.
|
java class name.java
|
You can set path ,than after use cmd and type class name xyz.java.
|
If you want to compile a java file then first of all you have to set the path of that file after that you can only run any of the file available on that location by using CMD and typing "javac filename.java".
|
JDK is required to compile the java code using 'javac' command.
|
To compile java file you need to use javac command e.g. javac myfile.java
this will compile the myfile and make the .class file. |
Compile Java
Compile Java through command line command is javac file name.java, example javac Hello.java
|
|
Yeah i agree with kevinbayne, you have need jdk. That can be solved your problem.
|
In JDK, open command prompt and
to compile type.. javac filename.java and to run/execute the file type- java filename |
All times are GMT -7. The time now is 07:19 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.