Jump to content
• Advertisement

# Java.. Eclipse setting up :s

This topic is 4412 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

I need a java compiler IDE I've used "editPlus2" before (for the past years while learning java). However, I have to change because my school's license on that product expires soon. So I've turned to Eclipse. Now, I've gone through tutorial 1 "helloWorld" (in eclipse) just to learn all the tools in eclipse. In EditPlus2 I had the following settings.. However, in eclipse i'm totally lost and have no idea where these options are. Help would be greatly appreciated on how to set up these settings. The left column is for Compile Java Source while the right column is for Interpret Java Bytecodes settings.
Quote:
 menu text: Compile Java Source | Interpret Java Bytecodes Command: C:\Sun\AppServer\jdk\bin\javac.exe | C:\Sun\AppServer\jdk\bin\java.exe Argument: $(FileName) |$(FileNameNoExt) Initial Directory : $(FileDir) |$(FileDir)

#### Share this post

##### Share on other sites
Advertisement
Compilation in Eclipse happens automatically - you just need to make sure that you've kept your java source under the 'source' dir (which you set in the project settings). Compile errors are reported in the 'problems' view, and as wavy red underlines in the code itself. You never have to manually build. [grin]

Running your java app is configured via the 'Run' menu. Select the 'Run...' option and you'll get a list of launch configurations. Create a new one of these (Eclipse usually does a good job of guessing your defaults) and edit it to specify your command line args, etc.

#### Share this post

##### Share on other sites
Alright thanks. One more question, this stupid eclipse compiler gives warnings for everything... It's very frustrating seeing all of the warnings.

Quote:
 Local variable 'g4' is never read.

In other IDE's like Jedit it didn't give me these warnings. Is there anyway to turn the warnings down a level?

#### Share this post

##### Share on other sites
Well personally I find the Eclipse compiler much better than the standard one - warnings are a good thing and let you know about potential problems or redundancies.

Personally I'd just fix the problems, but if you really want to then window->preferences, then expand 'java', 'compiler' and tinker in the 'errors/warnings' section, you can set a whole bunch of things to either error, warn or just ignore.

#### Share this post

##### Share on other sites
Another fun solution, you can click on the icon next to the line with that warning to see ways to handle it. For instance, if it's never read locally, you'll see options to remove the variable entirely or to add a @SuppressWarnings("unused") line before it.

#### Share this post

##### Share on other sites
**concerning the warning**

Quote:
 Flasher f1 = new Flasher(brampton, 2, 4, IS_ON); Flasher f2 = new Flasher(brampton, 2, 5, IS_ON); Flasher f3 = new Flasher(brampton, 2, 6, IS_ON);

This is where I was getting the warning messages. for some reason it gave me a message because i wasn't reading from it. However....... who says that I created the object f1 for that in the first place?? The reason I created it was because it creates a visual object within the constructor. No where did I intend to to read it. That's what bugs me about this compiler. It just makes assumptions.
[/warning message]

Thanks for your help on that part though.

Here's my second problem (its short)

Eclipse reminds me way too much of VB6 (not a good thing). I hate the auto-fill after each sentence you write. For example I type: "System." stop by this point before even getting to ".out.println" part, this message box is already going crazy on me. What ever happened to the good ol' write everything yourself editor. The stupid message box blocks a quarter of my code and I can't even see anything I'm writing after the "System."

Somebody... please let me know what's going on with this. Anyway to turn this off even to some small extent?

I'm really sorry to complain but this crosses the line for an java editor.

#### Share this post

##### Share on other sites
Quote:
Original post by Instigator
**concerning the warning**

Quote:
 Flasher f1 = new Flasher(brampton, 2, 4, IS_ON); Flasher f2 = new Flasher(brampton, 2, 5, IS_ON); Flasher f3 = new Flasher(brampton, 2, 6, IS_ON);

This is where I was getting the warning messages. for some reason it gave me a message because i wasn't reading from it. However....... who says that I created the object f1 for that in the first place?? The reason I created it was because it creates a visual object within the constructor. No where did I intend to to read it. That's what bugs me about this compiler. It just makes assumptions.
[/warning message]

No, creating the object and reading from the reference are two seperate things, and the compiler has picked up that you're not actually using the references. If you don't need it the equvilent code would be:
new Flasher(brampton, 2, 4, IS_ON);new Flasher(brampton, 2, 5, IS_ON);new Flasher(brampton, 2, 6, IS_ON);

Quote:
 Eclipse reminds me way too much of VB6 (not a good thing). I hate the auto-fill after each sentence you write. For example I type: "System." stop by this point before even getting to ".out.println" part, this message box is already going crazy on me. What ever happened to the good ol' write everything yourself editor. The stupid message box blocks a quarter of my code and I can't even see anything I'm writing after the "System."Somebody... please let me know what's going on with this. Anyway to turn this off even to some small extent?I'm really sorry to complain but this crosses the line for an java editor.

Yeah, I hated Eclipse when I started using it too. [grin] But theres a config setting for practically anything you'd want to tweek. You can change the delay of the autocomplete messages via Window->Preferences, then Java,Editor,Code Assist. You'll see a checkbox to toggle autoactivation, or you could make it wait a bit longer before appearing.

#### Share this post

##### Share on other sites
Quote:
 No, creating the object and reading from the reference are two seperate things, and the compiler has picked up that you're not actually using the references. If you don't need it the equvilent code would be:new Flasher(brampton, 2, 4, IS_ON);new Flasher(brampton, 2, 5, IS_ON);new Flasher(brampton, 2, 6, IS_ON);

Wow.. thanks for clearing that up. Well, you see my College teachers didn't pick up on that warning. He told us to use this code (I guess because the other compilers didn't pick up on this)

So thanks :)

Okay, so creating the refferences to the objects should only be done if I'm actually reading the objects, and otherwise do your way?

Exactly.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
34
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633331
• Total Posts
3011399
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!