• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to edit java  RSS feed

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit
I am still a bit confused so I think the best way for me to understand is to use a metaphor. If I want to edit HTML code I simply edit an html file in notepad. If I want to edit the java code found on this page http://docs.oracle.com/javase/tutorial/uiswing/examples/components/, the simpletabledemo, how do I edit it? Pardon my stupidity or slowness to learn. Please help me get from point A to point B. Thanks!
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think you can't use a text editor just as with HTML? A Java source file is just a text file.
 
Michael William
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been asking around and was told to use Eclipse. I am trying to use that code found at oracle's website to start with and branch out from there.
 
Michael William
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found a better link
http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#simple

when i dowload one of the examples, there is a src folder with a .java file in it this is not "executable" as a JNLP file is
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse is an IDE that edits Java text files. You can think of it a suped-up editor that understands Java. It is by no means necessary; just helpful.
 
Michael William
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so with this .java file that i have. I agree with your original statement that its editable, but how do i make it executable? do i need to compile or decompile it?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it needs to be compiled into a class file. Please find a basic tutorial on Java.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using IDEs like Eclipse, at a beginners stage is not a good idea. Like Bear pointed out, java is just a text format so any text editor will do. From personal experience I would recommendTextPad. If you search the forums, you will find similar threads where others have offered some different recommendations based on their experience.

In a nutshell, at this stage, dont even think of IDEs. Go for a simple text editor
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael William wrote:ok so with this .java file that i have. I agree with your original statement that its editable, but how do i make it executable? do i need to compile or decompile it?

Start at the beginning: Oracle's Java Tutorials - "Hello World!" for Microsoft Windows
 
Marshal
Posts: 56608
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get yourself a decent text editor and enable all the options I mentioned in that link.
 
Michael William
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to compile Java at the command prompt. Unfortunately, I had some issues so in order for it to work I had to move the actual file I wanted to be compiled to the same folder javac.exe was in. I will have to do some more work with that. My goal is to create an executable file. I now have a .class file but it wont launch?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael William wrote:in order for it to work I had to move the actual file I wanted to be compiled to the same folder javac.exe was in.

It's not a good idea to put your source code in the bin directory of your JDK installation. Instead, you should add the bin directory of the JDK to the PATH, as explained in the JDK installation instructions.

Michael William wrote:My goal is to create an executable file. I now have a .class file but it wont launch?

What did you try to run it? Did you follow the Hello World tutorial? Did you get errors? If so, then what errors? Have a look at the Common Problems page of the tutorial.
 
Michael William
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will touch on the Path issue in a moment, once I got the Class File, i tried to run the class file but was not successful
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"it was not successful" doesn't tell us much.

HOW did you try and run it? What EXACTLY did you type, and what EXACTLY did it say back to you?

There are really about a thousand things it could be. That's why it gives you helpful messages. They mean something. Without that info, it is impossible for anyone to help you.
 
Campbell Ritchie
Marshal
Posts: 56608
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be the path issue which is preventing you from running the .class file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!