School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,103 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,747 people online right now. Registration is fast and FREE... Join Now!



Help for a beginer

Help for a beginer Rate Topic: -----

#1 jaw  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 14-April 09


Dream Kudos: 0

Post icon  Posted 29 April 2009 - 08:44 AM

Hello i am new to java (realitively new to programing in general). I use textpad for my java programs. how do i compile and save the class file? i can compile it inside textpad but do not know how to make a class file.
Was This Post Helpful? 0
  • +
  • -


#2 jaw  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 14-April 09


Dream Kudos: 0

Post icon  Posted 29 April 2009 - 08:44 AM

Hello i am new to java (realitively new to programing in general). I use textpad for my java programs. how do i compile and save the class file? i can compile it inside textpad but do not know how to make a class file.
Was This Post Helpful? 0
  • +
  • -

#3 samuraitux  Icon User is offline

  • New D.I.C Head
  • Icon
  • Group: Contributors
  • Posts: 22
  • Joined: 29-April 09


Dream Kudos: 25

Posted 29 April 2009 - 09:14 AM

Hi Jaw. Well to compile the program you will run the following on any system.
javac <your app>.java



and to run the application use
java <your app> 



do not put the .class or you will get a runtime error.
Was This Post Helpful? 0
  • +
  • -

#4 Locke  Icon User is offline

  • Treasure Hunter
  • Icon
  • View blog
  • Group: Mentors
  • Posts: 4,350
  • Joined: 20-March 08


Dream Kudos: 350

Expert In: Java

Posted 29 April 2009 - 09:21 AM

Compiling it should make a .class file.
Was This Post Helpful? 0
  • +
  • -

#5 trtherrien  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 17-April 09


Dream Kudos: 0

Posted 29 April 2009 - 09:28 AM

View PostLocke, on 29 Apr, 2009 - 09:21 AM, said:

Compiling it should make a .class file.


I am not sure about the tool you are using, but normally it will end up in some sort of build folder. If you run javac from the command-line it will be in the same folder as the .java file. Also, the file tends to end up in a subdirectory based on the package name.

So:
package com.some.package



Will end up in:
build\com\some\package\something.class

Hope this helps.
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • Java Lover
  • Icon
  • Group: Mentors
  • Posts: 11,168
  • Joined: 06-March 08


Dream Kudos: 475

Posted 29 April 2009 - 03:11 PM

Duplicate topics merged
Please avoid double posting
Was This Post Helpful? 0
  • +
  • -

#7 jaw  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 14-April 09


Dream Kudos: 0

Posted 13 May 2009 - 08:27 AM

so how do i turn a .java file into a class file?
Was This Post Helpful? 0
  • +
  • -

#8 trtherrien  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 17-April 09


Dream Kudos: 0

Posted 13 May 2009 - 09:14 AM

View Postjaw, on 13 May, 2009 - 08:27 AM, said:

so how do i turn a .java file into a class file?


Basically, just run the javac command.

javac <filename>

example:
javac c:\hello\helloworld.java



Was This Post Helpful? 0
  • +
  • -

#9 jaw  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 14-April 09


Dream Kudos: 0

Posted 20 May 2009 - 08:23 AM

on the comand line?
Was This Post Helpful? 0
  • +
  • -

#10 Ed_Bighead  Icon User is offline

  • D.I.C Head
  • Icon
  • Group: Contributors
  • Posts: 169
  • Joined: 26-April 09


Dream Kudos: 50

Posted 20 May 2009 - 08:47 AM

Yep, granted you have the necessary Java files installed on your computer (JDK)
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month