Jump to content

How to setup Java & Netbeans/eclipse?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
thes1tuation

thes1tuation

    Newbie

  • Members
  • Pip
  • 8 posts
so, I have no idea how to compile the program's I make and run them with java VM... I know how to right some basic code but have no idea how to actually make these program's run to see if I'm doing it right.

Could someone please give me some instructions on how to setup netbeans or eclipse and how to set them up so the java VM pops up and is actually interactive...

Thanks!!!!

#2
Jhost

Jhost

    Newbie

  • Members
  • PipPip
  • 11 posts
Welll first you have to download the JDK from Developer Resources for Java Technology. After you install it, open your command prompt and navigate to the directory of your Java source files that you want to compile. Then once you are in the directory, type
javac thenameofyourjavafilehere.java
. And you have now compiled your first program. Now to run it stay in the same directory where you compiled and type
java thenameofyourjavafilehere
but do not type any extension this time. You have now run your first java program.

Now to get you IDE, I highly recommend Eclipse, go to Eclipse.org home and download Eclipse for Java Developers. Once it is downloaded, extract it to the directory where you want it and if you would like, create a shortcut to the desktop for it. Now once its open choose your workspace, which is the main folder that is going to contain each of your project folders. Then once Eclipse is open, you can customize the view by going to Window > Show View, and selecting them from there. Now to create a new Java Project go to File > New > Project... and go under General and select project, and customize how you want your project. Once you have a new project, begin coding and to compile/run hit the play button at the top of the screen.

Hope this helped!
Posted Image
Posted Image

#3
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts
Here you can learn how to set up Netbeans and write applications.
Getting Started With the NetBeans IDE Tutorial

#4
thes1tuation

thes1tuation

    Newbie

  • Members
  • Pip
  • 8 posts
Hey that helped a lot thanks! I just have one more quick question; how do I make it so there's an interactive user module so they can enter variables and have a screen pop up (like i'm using a book to learn JAVA and i'm at a lesson where I have to add 2 integers, but... I have no idea if I wrote the program correctly because I can't actually test/deploy it.

#5
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts

thes1tuation said:

Hey that helped a lot thanks! I just have one more quick question; how do I make it so there's an interactive user module so they can enter variables and have a screen pop up (like i'm using a book to learn JAVA and i'm at a lesson where I have to add 2 integers, but... I have no idea if I wrote the program correctly because I can't actually test/deploy it.

Posted Image

To Run Your Code Click Shift+F6

#6
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts
If you got any other question feel free to post!

#7
thes1tuation

thes1tuation

    Newbie

  • Members
  • Pip
  • 8 posts
Yea, but for example:

I made a program that says "I Love Java" and it just showed up on the bottom part of eclipse, while in my book a new screen is suppose to pop up, and now when I try to do my calculator program and run it it just says it ran without error but I can't actually use it or see it. How do i make the interactive window pop up (I think that's what it's called)

#8
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts

thes1tuation said:

Yea, but for example:

I made a program that says "I Love Java" and it just showed up on the bottom part of eclipse, while in my book a new screen is suppose to pop up, and now when I try to do my calculator program and run it it just says it ran without error but I can't actually use it or see it. How do i make the interactive window pop up (I think that's what it's called)

Interactive window == Graphical User Interface
In java graphical interfaces are created with AWT or SWING. (There are others like SWT, but not important for beginner)
Do you know how to program with Swing or AWT?

#9
thes1tuation

thes1tuation

    Newbie

  • Members
  • Pip
  • 8 posts

isuru said:

Interactive window == Graphical User Interface
In java graphical interfaces are created with AWT or SWING. (There are others like SWT, but not important for beginner)
Do you know how to program with Swing or AWT?

I have no idea how to program with swing or AWT. Care elaborating on what it is, do I have to download it or what?
Thanks.

#10
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts

thes1tuation said:

I have no idea how to program with swing or AWT. Care elaborating on what it is, do I have to download it or what?
Thanks.

No.
You have to learn Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials) to create interactive windows.
But first of all make sure you remember all java syntax and basic programming.
I strongly recommend you start reading java official tutorial.
The Really Big Index

And I recommend these books
Head first Java - Google Books
Java 2 scratch

#11
thes1tuation

thes1tuation

    Newbie

  • Members
  • Pip
  • 8 posts

isuru said:

No.
You have to learn Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials) to create interactive windows.
But first of all make sure you remember all java syntax and basic programming.
I strongly recommend you start reading java official tutorial.
The Really Big Index

And I recommend these books
Head first Java - Google Books
Java 2 scratch

Thanks so much, I'll defiantly read those!