• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I can't type any code in eclipse

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
I downloaded Eclipse. I don't know how to get started with typing any code into it. This is why I am here I don't know how to work any of these ide's. I used IntelliJ and was able to write one program. Could not write a second one. Any help is appreciated.
Mark
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every IDE has its own models and assumptions, and you need to understand these before you will be able to make much progress.

Although Eclipse looks like a kind of fancy text editor, it is really designed so you can work on multiple projects at once.  All code in Eclipse needs to be in a "project". This can easily confuse you if you just want to get started with some great code you have seen here at the Ranch!

The first thing to do is to select File -> New -> Java Project.
Give your project a name in the top field, then click "Finish" at the bottom.
A box will pop up asking about modules. Unless you are very experienced with modules, I strongly recommend clicking "Don't Create"

This will create a new project with the minimum structure in the current "workspace". For a first project you don't really need to worry about workspaces, just know that a workspace is a folder somewhere in your home folder and probably named something like "eclipse_workspace".

Once you have a project, it should appear in the "Package Explorer" at the left of the Eclipse window. Click the little triangle to show its contents if they are not already visible.

Java classes should (almost) always be in a package, and Eclipse prefers you to create a package first, so you have somewhere to put your code.

Right-click on the source folder and select New -> Package.
Give your package a name, such as example ancd click Finish. Note that the package name starts with a small letter.

Once you have created a package it will also appear in the project. Finally, you are in a position to create a Java class.

Right-click your new package and select  New -> Class.
Give the class a name, such as Example, and click Finish. Note that a class name should always start with a capital letter.

You should now have a project with a Java class in a package, ready for you to type your code an run it.

I hope that helps
 
Mark Roberge
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I type all of the code into this that you just helped me with? Your instructions are very good. Thanks for that.
Mark
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic