![]() |
|
|
#1 |
![]() |
.java to .jar file
Hi guys!
I have a problem i think i dont know how to do this little thing I have searched around the web, but i cant find anyone to explain it how to and where to put this code down here in order for the compilator to convert it from .java to a .jar file so the program or games i do in neatbeans can be executed in my mobile phone! Anyone can help??? The code is this one: jar cf jar-file input-file(s) |
|
|
|
|
|
#2 |
![]() Join Date: May 2009
Location: In the mountains :) Adirondacks in NY (US)
Posts: 3,709 (2.49/day)
Thanks: 4,547
Thanked 1,449 Times in 1,040 Posts
|
well you'd put in in your command prompt, from wherever it can execute the java compiler.
if installed correctly, that should be anywhere. but you may have to navigate to the java install directory to call the executable. i have no idea about java specifically, so i can't help much more than that i'm afraid. you might want to mention windows or linux, as that will matter. i assume windows?
__________________
Donate to TPU TeamSpeak Server ![]() TPU TS: ts21.gameservers.com:9207 PSN / XBL / Steam = digibucc | Origin / BF3 = digibuc |
|
|
|
|
|
#3 |
![]() |
I have already posted windows in my system specs
|
|
|
|
|
|
#4 |
![]() Join Date: Mar 2010
Location: UK
Posts: 177 (0.15/day)
Thanks: 292
Thanked 67 Times in 48 Posts
|
Netbeans is the same on all OSs: Right-click on your project and choose "clean & build". The Jar executable will be made and put in the "dist" sub folder of your project.
|
|
|
|
|
|
#5 | |
|
Linux Advocate
Join Date: Nov 2006
Posts: 10,284 (4.27/day)
Thanks: 1,219
Thanked 2,789 Times in 1,801 Posts
|
Quote:
obviously didnt look to hard
|
|
|
|
|
|
|
#6 |
![]() |
I know the manual, i got the code from there
I just dont know where to put the code in the program i made and what to put in :S? |
|
|
|
|
|
#7 |
|
Linux Advocate
Join Date: Nov 2006
Posts: 10,284 (4.27/day)
Thanks: 1,219
Thanked 2,789 Times in 1,801 Posts
|
if you know the manual then you know you dont put the code in the program, you convert all of your java class files into a jar file using their compiler.
|
|
|
|
|
|
#8 |
![]() Join Date: Mar 2009
Posts: 490 (0.32/day)
Thanks: 0
Thanked 171 Times in 158 Posts
|
As a side note to Easy Rhinos comment, you can only jar .class files, meaning that you need to compile all the .java files and them jar the .class files resulting from the compilation. Example:
Code:
javac Test.java jar cf Teste.jar Test.class |
|
|
|
| The Following User Says Thank You to temp02 For This Useful Post: |
|
|
#9 |
![]() |
Ok, but where to put the code?
I mean in a new class? In the middle of a class? And inside are so many classes, which means with your code man, i need to put all in??? Or should i create the code again and again? |
|
|
|
|
|
#10 | |
![]() Join Date: Mar 2010
Location: UK
Posts: 177 (0.15/day)
Thanks: 292
Thanked 67 Times in 48 Posts
|
Quote:
but anyway since you are using Netbeans, it will sort all this for you as I already said ![]() "Clean & build" project = jar file |
|
|
|
|
|
|
#11 |
|
Linux Advocate
Join Date: Nov 2006
Posts: 10,284 (4.27/day)
Thanks: 1,219
Thanked 2,789 Times in 1,801 Posts
|
you can either use the command line or whatever program you may have used to write the program.
|
|
|
|
|
|
#12 | |
![]() Join Date: Mar 2009
Posts: 490 (0.32/day)
Thanks: 0
Thanked 171 Times in 158 Posts
|
Quote:
If I were you, for a big standalone application I would follow robn advice and use NetBeans to manage all the files in a projects, and let NetBeans/Ant figure out how to properly compile and build the jar (if you do use NetBeans the resulting jar file will be inside the dist folder inside the project folder). |
|
|
|
|
| The Following User Says Thank You to temp02 For This Useful Post: |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can i extract a bios file from an Asus .exe file ?? | Jonny_doe | AMD / ATI | 38 | Aug 8, 2011 06:51 AM |
| [Case Gallery] Jar.IT | lutvi | Case Mod Gallery | 5 | Nov 19, 2010 06:26 AM |
| Problem saving Asus bios version 1009 as ROM file, autosaves as AMI file. | tepabajo | Motherboards & Memory | 2 | Jan 2, 2006 10:23 PM |