Be a Supporter!

Javascript Class files

  • 424 Views
  • 11 Replies
New Topic Respond to this Topic
StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Javascript Class files 2008-06-08 10:36:03 Reply

I'm starting learning javascript, but I need a compiler to create / read class files. Preferably free and legal. Thanks.

kernalphage
kernalphage
  • Member since: Jan. 2, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:20:41 Reply

well, there's notepad++...
but that just highlights the script tags.

but... compile? doesn't the browser do that already?
Like... save an .html that imports the external file... and it should work.

right?

or am i getting the terminology messed up again?
elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Javascript Class files 2008-06-08 11:33:32 Reply

Javascript isn't compiled, it's interpreted by the browser.


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:37:36 Reply

At 6/8/08 11:33 AM, elbekko wrote: Javascript isn't compiled, it's interpreted by the browser.

I want to open / edit / create .class files though. notepad just interprets them as random characters and firefox cant edit them.

thoughtpolice
thoughtpolice
  • Member since: Mar. 24, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:39:28 Reply

JavaScript is, more or less, the universal web language. Most all implementations of JavaScript are not actually compilers/interpreters, but inside (most) web browsers. This is so that it can be executed by the browser based on events - when the webpage loads, when you click a button, etc. etc..

There are however, a few standalone deployments of JavaScript that you can for regular application development.

The javascript engine used by Firefox is SpiderMonkey: http://www.mozilla.org/js/spidermonkey/
There is also Rhino, which is JavaScript on top of the Java Virtual Machine, also made by Mozilla: http://www.mozilla.org/rhino/

Those are the only two off the top of my head. Rhino is actually more suited for application development, but I can't comment on setting it up.
With SpiderMonkey, if you get it built or download a binary, you can just execute it and start typing in javascript right away; this might be better for teaching yourself things. Note though, that most tutorials on JavaScript are geared towards actually being used in a browser - not in just a standalone environment, meaning you won't be able to apply a bit of stuff (since it'll be based on browser events and you're not using a browser, basically.)

Feel free to ask more if I don't make sense.


omg.
Playstation Network tag: muffin-noodle
the empty set

thoughtpolice
thoughtpolice
  • Member since: Mar. 24, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:42:32 Reply

Okay, hold on. I just got a kick in the head and I know what you're asking now.

First, you're talking about Java, not JavaScript.
Second, Java code goes into a file with a ".java" extension, and when compiled, the compiler creates an associated ".class" file. You don't edit the .class one - it's the code in a bytecode compiled form.

Maybe that answers a few things? :)


omg.
Playstation Network tag: muffin-noodle
the empty set

StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:47:24 Reply

Wow. That's perfect, thanks! The mirrors were hard to navigate, but I got rhino eventually.

StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 11:48:27 Reply

At 6/8/08 11:42 AM, thoughtpolice wrote: Okay, hold on. I just got a kick in the head and I know what you're asking now.

First, you're talking about Java, not JavaScript.
Second, Java code goes into a file with a ".java" extension, and when compiled, the compiler creates an associated ".class" file. You don't edit the .class one - it's the code in a bytecode compiled form.

Maybe that answers a few things? :)

Sorry, just saw this. Yep, that's what I want, sorry for calling javascript, but I know the difference now. It's my fault entirely.

kernalphage
kernalphage
  • Member since: Jan. 2, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 12:14:47 Reply

ahh, if you're talking Java, try Jcreator, they've got a personal edition. like they said before, edit the .java files....

to compile it, you need the... documentation or something. i've gotten along on through the AP exam with 1.6, and not docs... but i can't help but feel like i'm missing something. so if you post the link, you'll be helping 2 people :D

StarCleaver
StarCleaver
  • Member since: Jan. 3, 2003
  • Offline.
Forum Stats
Member
Level 29
Blank Slate
Response to Javascript Class files 2008-06-08 12:47:54 Reply

At 6/8/08 12:14 PM, kernalphage wrote: ahh, if you're talking Java, try Jcreator, they've got a personal edition. like they said before, edit the .java files....

to compile it, you need the... documentation or something. i've gotten along on through the AP exam with 1.6, and not docs... but i can't help but feel like i'm missing something. so if you post the link, you'll be helping 2 people :D

Personally, I prefer to use the Eclipse Java IDE when working with Java. You can download the IDE here. It has everything you need. It will compile on the fly and will help you to easily manage projects. It is also a great platform from which you can work with other languages besides Java by simply downloading plugins.


I could surely die
If I only had some pie
Club-a-Club Club, son

BBS Signature
authorblues
authorblues
  • Member since: Jun. 21, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to Javascript Class files 2008-06-08 13:31:08 Reply

At 6/8/08 10:36 AM, StaliN98 wrote: I'm starting learning javascript, but I need a compiler to create / read class files. Preferably free and legal. Thanks.

.class files are for java, not javascript. they are completely seperate languages.


BBS Signature
StaliN98
StaliN98
  • Member since: Jul. 27, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Javascript Class files 2008-06-08 14:47:11 Reply

At 6/8/08 01:31 PM, authorblues wrote:
At 6/8/08 10:36 AM, StaliN98 wrote: I'm starting learning javascript, but I need a compiler to create / read class files. Preferably free and legal. Thanks.
.class files are for java, not javascript. they are completely seperate languages.

Yes, I spotted that before in my other post. Thanks anyway.
And eclipse is just what I need, thanks!