Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Compiling A .java File In To A .exe File
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default Compiling A .java File In To A .exe File - 06-13-2012, 03:51 PM

Hello Alice Community!

Today, I am starting my journey as I begin to learn Java, but I lack the basic knowledge of how I could compile a .java file into a .exe file that only needs the JRE (Java Runtime Environment) to run.
   
Reply With Quote
Many solutions
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Many solutions - 06-19-2012, 10:10 AM

You can use the command line to create the executable class files using javax, but it's easier on your brain to use one of the many IDE's that are available for free on the Internet.

Entry Level:
BlueJ
Greenfoot
JGrasp
JCreator

Professional:
Eclipse
NetBeans

Search Wikipedia for: Comparison of Integrated Development Environments
for links to many IDE's for Java. Each site should have downloads and tutorials.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 06-19-2012, 10:23 PM

I'm using Eclipse and Netbeans.



I feel professional!


(')>
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 06-20-2012, 12:06 AM

Quote:
Originally Posted by x2495iiii View Post
I'm using Eclipse and Netbeans.



I feel professional!
Eclipse is really nice with it's colored syntax and short cuts, and it allows easy organization.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-20-2012, 07:33 AM

Quote:
Originally Posted by sfunk View Post
Eclipse is really nice with it's colored syntax and short cuts, and it allows easy organization.
Yes, I use Eclipse too. It's very intuitive, easy to use while coding.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
I Do Too
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default I Do Too - 06-20-2012, 08:20 AM

But,
The others, mostly developed by Computer Science Departments at Major Universities, aid the transition to Java by incorporating visual aids during execution and allowing novices to actually see the process. Web sites for the free products describe the visual aids.

As for you "Professionals"! That's Great! I've spent the last decade trying to make more of you, and send them to College.

Last edited by MrMoke; 06-20-2012 at 08:36 AM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 06-20-2012, 03:27 PM

Quote:
Originally Posted by MrMoke View Post
But,
The others, mostly developed by Computer Science Departments at Major Universities, aid the transition to Java by incorporating visual aids during execution and allowing novices to actually see the process. Web sites for the free products describe the visual aids.

As for you "Professionals"! That's Great! I've spent the last decade trying to make more of you, and send them to College.
Time well spent. Bravo, MrMoke.

And in hindsight, my grasp of NetBeans is tenuous at best. I used it to make some neat java-powered web pages, and that's about it.


(')>
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 06-23-2012, 10:56 PM

Okay. The Dummies Book says to use Eclipse, but since everyone is saying that it is more more professionals, and I am not a professional, should I actually use it, or should I do as the book says? I have already installed it on my computer.
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 06-24-2012, 12:00 AM

Quote:
Originally Posted by MrMoke View Post
But,
As for you "Professionals"! That's Great! I've spent the last decade trying to make more of you, and send them to College.
I am definitely not a professional. I just like to dabble in anything that relates to computers. It will never be a career, more like a very fun and mind opening hobby.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 06-24-2012, 08:49 PM

I find the best way to learn a new programming language is to dive right in. They are all basically more or less the same, so it is just a case of learning what is unique to that language.

Let Google be your friend and copy other people's work at first (innocently), start to modify it and soon you will get the hang of doing it yourself.

Eclipse really isn't that hard, in fact it is awesome because it is so good at realtime error checking and has a lot of cool features that make it much easier to code.

As a base to start with, I suggest creating a jar that you can run with a console, via a Batch file.

In Eclipse (presuming you know the basics of Java) create yourself a new workspace, add to it a new Java project.
Give the project a name and confirm it.
Create your package (by standard it is the reverse of your website plus the project name - ie com.google.project).
Create your main class, add the method:
Code:
public static void main(String[] args) {
        // start it here
}
Add all the java/classes/packages etc that you want to.
Go to File>Export
Select JAR file.
Select the required resources.
Skip the next screen.
Select your main class.
Find where the jar file saved to.
Create a new text file in the same folder with this as its contents:
Click here to view, I had to paste it externally as I get a 500 bad request error otherwise
Replace "Title goes here" with your title, replace "Name_of_JAR" with the name of the jar and save.
Rename the text file to "RUN.bat".
Double click it and you will get a cmd window which can utilise System.out and System.in textually.

Sorry if that seems wrong to you, but I jut started properly learning Java yesterday.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.