Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

generate javadoc  RSS feed

 
zohreh talebi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i want to generate javadoc for one of my project but it has error,it say No packages or classes specified.for another project it is do. what should i do?

thanks
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!!

Welcome to JAVA Ranchers....

Well for javadoc you need to create the class with public access specifiers.. well this may be one reason.. But although could you give a snap shot of java file.. what you are doing exactly....

Just show your java file... here so that we can analyze...


 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by zohreh talebi:
Hi
i want to generate javadoc for one of my project but it has error,it say No packages or classes specified.for another project it is do. what should i do?

thanks


Please tell us more about exactly how you're running the Javadoc tool. For example:



So what are you running and have you looked at the documentation?

http://java.sun.com/j2se/javadoc/faq/index.html#howdoirunjavadoc

Originally posted by Ankur Sharma:
Hi!!

Welcome to JAVA Ranchers....

Well for javadoc you need to create the class with public access specifiers.. well this may be one reason.. But although could you give a snap shot of java file.. what you are doing exactly....


No you don't.

Originally posted by Ankur Sharma:

Just show your java file... here so that we can analyze...




The source seems irrelevent at this point.
 
zohreh talebi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear freinds

I do in this way:
1)I select project from menu toolbar and press Generate javadoc then
2)In the tree control,i select my project which i want to generate Javadoc.
3)I Select public buttons.
4)I use Standard Doclet radio button selected...next
5)i select the destination field.
6)I Press Finish to create generate Javadoc.

I make a seprate project for this program.it it my cod.
thanks a lot for your answers and i am very glad to join this group.


package Q4_midTerm;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Scanner;
/**
*
* in this class, for having a binary file at first write information
* in a book file that it is made in drive D.
* than read information from this file and write them into book2
* file that it is made in drive D.
*
*/


public class Book implements Serializable {


private int number;
private char[] name;
private char[] code;
private double price;
private static final long serialVersionUID = 1L;

public Book (){};

public Book(int number, char[] name, char[] code, double price) {

this.number = number;
this.name = name;
this.code = code;
this.price = price;
}
public char[] getCode() {
return code;
}
public void setCode(char[] code) {
this.code = code;
}
public char[] getName() {
return name;
}
public void setName(char[] name) {
this.name = name;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}

public static void main(String args[]){
try{

Book book = new Book();
Scanner in = new Scanner(System .in);
ObjectOutputStream out = new ObjectOutputStream (
new FileOutputStream("D://book.txt"));

// at first, should write informations in to a file
// for haveing a binary file.

System.out.println("Enter your information of book.");
System .out.println("How many book do you want to enter:");
int num = in.nextInt();
book.setNumber(num);
out.write(num);

System .out.println("Enter price :");
double price = in.nextDouble();
book.setPrice(price);
out.writeDouble(price);

System .out.println("Enter name :");
String Name = in.next();
int len1 = Name.length();
out.write(len1);
out.write(Name.getBytes());

System .out.println("Enter code :");
String Code = in.next();
int len2 = Code.length();
out.write(len2);
out.write(Code.getBytes());
out.flush();
out.close();// close write stream


ObjectInputStream objIn = new ObjectInputStream(new FileInputStream("D://book.txt"));

// reading number of book

int numberOfbook = objIn.read();

// reading price of book

double bookPrice = objIn.readDouble();

// reading name of book

int lenOfName = objIn.read();
byte[] data1 = new byte[lenOfName];
objIn.read(data1);
String bookName = new String(data1);

// reading code of book

int lenOfCode = objIn.read();
byte[] data2 = new byte[lenOfCode];
objIn.read(data2);
String bookCode = new String(data2);

// print information in console.

///System.out.println("number of book :" + numberOfbook);
///System.out.println("price of book:" + bookPrice);
///System.out.println("name of book:" + bookName);
/// System.out.println("code of book:" + bookCode);


objIn .close();// close read stream

// write information in to new file.

ObjectOutputStream out2 = new ObjectOutputStream(
new FileOutputStream(new File("D:// book2.txt")));
out2.writeInt(numberOfbook);
out2.writeDouble(bookPrice);
out2.writeBytes(bookName);
out2.writeBytes(bookCode);
out2.close();
}

catch(FileNotFoundException io)
{
System.out.println("an erore eccured.");

}
catch(IOException io)
{
System.out.println("an error accerured.");
}


}
}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This looks more like a README.TXT than a javadoc
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16027
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by zohreh talebi:
dear freinds

I do in this way:
1)I select project from menu toolbar and press Generate javadoc then
2)In the tree control,i select my project which i want to generate Javadoc.
3)I Select public buttons.
4)I use Standard Doclet radio button selected...next
5)i select the destination field.
6)I Press Finish to create generate Javadoc.


It sounds like you are using an IDE, you're not running the javadoc tool in a command window or shell window. But which IDE are you using? Eclipse? NetBeans? Something else?

What error messages do you get exactly, or how does the output differ from what you expect?
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's Eclipse and from the sounds of it you are selecting a project without any source files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!