Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Have recently started to study programming and have chosen java as the language that claims you need to only write the codes once, and then it can run anywhere. So studied a book about it explaining most the basic elements about jave.
but the problem is, anything you write, will be stored as byte codes in .class files which need the jre or a compiler to run; and it doesnt explain at all how to convert these .class files to .exe or .app files.
is it that the book is incomplete or just this level doesnt belong to java teacing books; and, is there any source or toturial to explain how to make actual softwares out of .class files?

What I have tried:

actually I have two books studied, but none did explain this.
Posted
Updated 16-Jan-22 4:06am
Comments
Richard MacCutchan 16-Jan-22 10:39am    
Java is freely available on most modern platforms so you do not need to convert your class files. Just copy them over and run them under the Java system that is available. That is what is meant by "write once, run anywhere".
T1xT 16-Jan-22 10:47am    
But how to do it, specially if you want to offer friends to use the .class as a software; as far as I know it needs something like eclipse (which isn't suitable at all) and by double clicking on it, it just pops up the "Windows can't open this file" window.
Richard MacCutchan 16-Jan-22 11:06am    
You cannot double click it to run, as Windows does not recognise it is an executable type. You must use Java to run it, and all you need is the Java runtime (which is automatically installed on most systems) and the class file.
T1xT 16-Jan-22 11:13am    
Ok, thanks.

1 solution

Following step-by-step procedure to create standalone App.

Creating a Stand-Alone Java Application[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900