copilation error

wht does these jar,option bla bla error mean???

Page 1 of 1

9 Replies - 882 Views - Last Post: 14 December 2008 - 11:33 AM Rate Topic: -----

#1 anum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-November 08

copilation error

Post icon  Posted 13 December 2008 - 08:13 AM

[/b]hiii!!

plz solve my prob m working on project which is on inventory system..
when i compile my code it ives no error
bt whn i run it give the following error :v: ...m fed up of it i dn hav much tym...
its sumthng realted to my instalation of java..
plz guide me wht should i do wth it...plzzzzzzzzzzzzzzzz :crazy:
my last date of submission is 18-dec-2008
[font=Comic Sans Ms][b]



D:\jdk1.2.2\bin\java.exe
Working Directory - D:\jdk1.2.2\demo\applets\BarChart\
Class Path - .;c:\Kawapro5.0\kawaclasses.zip;d:\jdk1.2.2\lib\tools.jar;d:\jdk1.2.2\jre\lib\rt.jar;d:\jdk1.2.2\jre\lib\i18n.jar
Usage: java.exe [-options] class [args...]
(to execute a class)
or java.exe -jar [-options] jarfile [args...]
(to execute a jar file)

where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-? -help print this help message
-X print help on non-standard options
Process Exit...

Is This A Good Question/Topic? 0
  • +

Replies To: copilation error

#2 Ostralis  Icon User is offline

  • #include <greeter>
  • member icon

Reputation: 9
  • View blog
  • Posts: 559
  • Joined: 13-December 08

Re: copilation error

Posted 13 December 2008 - 08:25 AM

Do you have the right libraries open, like apcslib, or java.util.*?
Was This Post Helpful? 0
  • +
  • -

#3 anum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-November 08

Re: copilation error

Posted 13 December 2008 - 08:43 AM

View PostRoux, on 13 Dec, 2008 - 07:25 AM, said:

Do you have the right libraries open, like apcslib, or java.util.*?

Was This Post Helpful? 0
  • +
  • -

#4 BetaWar  Icon User is online

  • #include "soul.h"
  • member icon

Reputation: 1167
  • View blog
  • Posts: 7,213
  • Joined: 07-September 06

Re: copilation error

Posted 13 December 2008 - 09:34 AM

Why don't you post the code so we can take a look at it?
Was This Post Helpful? 0
  • +
  • -

#5 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 101
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: copilation error

Posted 13 December 2008 - 11:07 AM

What do you type in when you try to run the program?
Was This Post Helpful? 0
  • +
  • -

#6 Ostralis  Icon User is offline

  • #include <greeter>
  • member icon

Reputation: 9
  • View blog
  • Posts: 559
  • Joined: 13-December 08

Re: copilation error

Posted 13 December 2008 - 01:21 PM

Yeah seriously, we need to see some program to understand your problem, thanks!
Was This Post Helpful? 0
  • +
  • -

#7 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: copilation error

Posted 13 December 2008 - 08:49 PM

The syntax is:

d> javac MyClass.java
Was This Post Helpful? 0
  • +
  • -

#8 anum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-November 08

Re: copilation error

Posted 14 December 2008 - 04:17 AM

View PostRoux, on 13 Dec, 2008 - 07:25 AM, said:

Do you have the right libraries open, like apcslib, or java.util.*?





i dn knw abt these libraries", li me send u my program..
actually i get thz error for most of programs..
thz is test program in my jdk..(jst 4r testing cuz of continously installing window i lost my programs.. :) sry)
[code]
/*
* @(#)Chart.java 1.7 01/11/29
*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/

import java.awt.Graphics;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.io.*;
import java.lang.*;
import java.net.URL;

public class Chart extends java.applet.Applet {
static final int VERTICAL = 0;
static final int HORIZONTAL = 1;

static final int SOLID = 0;
static final int STRIPED = 1;

int orientation;
String title;
Font titleFont;
FontMetrics titleFontMetrics;
int titleHeight = 15;
int columns;
int values[];
Object colors[];
Object labels[];
int styles[];
int scale = 10;
int maxLabelWidth = 0;
int barWidth;
int barSpacing = 10;
int max = 0;

public synchronized void init() {
String rs;

titleFont = new java.awt.Font("Courier", Font.BOLD, 12);
titleFontMetrics = getFontMetrics(titleFont);
title = getParameter("title");

if (title == null) {
title = "Chart";
}
rs = getParameter("columns");
if (rs == null) {
columns = 5;
} else {
columns = Integer.parseInt(rs);
}
rs = getParameter("scale");
if (rs == null) {
scale = 10;
} else {
scale = Integer.parseInt(rs);
}

rs = getParameter("orientation");
if (rs == null) {
orientation = VERTICAL;
} else if (rs.toLowerCase().equals("vertical")) {
orientation = VERTICAL;
} else if (rs.toLowerCase().equals("horizontal")) {
orientation = HORIZONTAL;
} else {
orientation = VERTICAL;
}
values = new int[columns];
colors = new Color[columns];
labels = new String[columns];
styles = new int[columns];
for (int i=0; i < columns; i++) {
// parse the value for this column
rs = getParameter("C" + (i+1));
if (rs != null) {
try {
values[i] = Integer.parseInt(rs);
} catch (NumberFormatException e) {
values[i] = 0;
}
}
if (values[i] > max) {
max = values[i];
}

// parse the label for this column
rs = getParameter("C" + (i+1) + "_label");
labels[i] = (rs == null) ? "" : rs;
maxLabelWidth = Math.max(titleFontMetrics.stringWidth((String)(labels[i])),
maxLabelWidth);

// parse the bar style
rs = getParameter("C" + (i+1) + "_style");
if (rs == null || rs.toLowerCase().equals("solid")) {
styles[i] = SOLID;
} else if (rs.toLowerCase().equals("striped")) {
styles[i] = STRIPED;
} else {
styles[i] = SOLID;
}
// parse the color attribute for this column
rs = getParameter("C" + (i+1) + "_color");
if (rs != null) {
if (rs.equals("red")) {
colors[i] = Color.red;
} else if (rs.equals("green")) {
colors[i] = Color.green;
} else if (rs.equals("blue")) {
colors[i] = Color.blue;
} else if (rs.equals("pink")) {
colors[i] = Color.pink;
} else if (rs.equals("orange")) {
colors[i] = Color.orange;
} else if (rs.equals("magenta")) {
colors[i] = Color.magenta;
} else if (rs.equals("cyan")) {
colors[i] = Color.cyan;
} else if (rs.equals("white")) {
colors[i] = Color.white;
} else if (rs.equals("yellow")) {
colors[i] = Color.yellow;
} else if (rs.equals("gray")) {
colors[i] = Color.gray;
} else if (rs.equals("darkGray")) {
colors[i] = Color.darkGray;
} else {
colors[i] = Color.gray;
}
} else {
colors[i] = Color.gray;
}
}
switch (orientation) {
case VERTICAL:
default:
barWidth = maxLabelWidth;
resize(Math.max(columns * (barWidth + barSpacing),
titleFontMetrics.stringWidth(title)) +
titleFont.getSize() + 5,
(max * scale) + (2 * titleFont.getSize()) + 5 + titleFont.getSize());
break;
case HORIZONTAL:
barWidth = titleFont.getSize();
resize(Math.max((max * scale) + titleFontMetrics.stringWidth("" + max),
titleFontMetrics.stringWidth(title)) + maxLabelWidth + 5,
(columns * (barWidth + barSpacing)) + titleFont.getSize() + 10);
break;
}
}

public synchronized void paint(Graphics g) {
int i, j;
int cx, cy;
char l[] = new char[1];


// draw the title centered at the bottom of the bar graph
g.setColor(Color.black);
i = titleFontMetrics.stringWidth(title);
g.setFont(titleFont);
g.drawString(title, Math.max((getSize().width - i)/2, 0),
getSize().height - titleFontMetrics.getDescent());
for (i=0; i < columns; i++) {
switch (orientation) {
case VERTICAL:
default:
// set the next X coordinate to account for the label
// being wider than the bar getSize().width.
cx = (Math.max((barWidth + barSpacing),maxLabelWidth) * i) +
barSpacing;

// center the bar chart
cx += Math.max((getSize().width - (columns *
(barWidth + (2 * barSpacing))))/2,0);

// set the next Y coordinate to account for the getSize().height
// of the bar as well as the title and labels painted
// at the bottom of the chart.
cy = getSize().height - (values[i] * scale) - 1 - (2 * titleFont.getSize());

// draw the label
g.setColor(Color.black);
g.drawString((String)labels[i], cx,
getSize().height - titleFont.getSize() - titleFontMetrics.getDescent());

// draw the shadow bar
if (colors[i] == Color.black) {
g.setColor(Color.gray);
}
g.fillRect(cx + 5, cy - 3, barWidth, (values[i] * scale));
// draw the bar with the specified color
g.setColor((Color)(colors[i]));
switch (styles[i]) {
case SOLID:
default:
g.fillRect(cx, cy, barWidth, (values[i] * scale));
break;
case STRIPED:
{
int steps = (values[i] * scale) / 2;
int ys;

for (j=0; j < steps; j++) {
ys = cy + (2 * j);
g.drawLine(cx, ys, cx + barWidth, ys);
}
}
break;
}
g.drawString("" + values[i],
cx,
cy - titleFontMetrics.getDescent());
break;
case HORIZONTAL:
// set the Y coordinate
cy = ((barWidth + barSpacing) * i) + barSpacing;

// set the X coordinate to be the getSize().width of the widest
// label
cx = maxLabelWidth + 1;

cx += Math.max((getSize().width - (maxLabelWidth + 1 +
titleFontMetrics.stringWidth("" +
max) +
(max * scale))) / 2, 0);
// draw the labels and the shadow
g.setColor(Color.black);
g.drawString((String)labels[i], cx - maxLabelWidth - 1,
cy + titleFontMetrics.getAscent());
if (colors[i] == Color.black) {
g.setColor(Color.gray);
}
g.fillRect(cx + 3,
cy + 5,
(values[i] * scale),
barWidth);

// draw the bar in the current color
g.setColor((Color)(colors[i]));
switch (styles[i]) {
case SOLID:
default:
g.fillRect(cx,
cy,
(values[i] * scale),
barWidth);
break;
case STRIPED:
{
int steps = (values[i] * scale) / 2;
int ys;

for (j=0; j < steps; j++) {
ys = cx + (2 * j);
g.drawLine(ys, cy, ys, cy + barWidth);
}
}
break;
}
g.drawString("" + values[i],
cx + (values[i] * scale) + 3,
cy + titleFontMetrics.getAscent());

break;
}
}
}
public String getAppletInfo() {
return "Title: Bar Chart \nAuthor: Sami Shaio \nA simple bar chart demo.";
}

public String[][] getParameterInfo() {
String[][] info = {
{"title", "string", "The title of bar graph. Default is 'Chart'"},
{"scale", "int", "The scale of the bar graph. Default is 10."},
{"columns", "int", "The number of columns/rows. Default is 5."},
{"orientation", "{VERTICLE, HORIZONTAL}", "The orienation of the bar graph. Default is VERTICLE."},
{"c#", "int", "Subsitute a number for #. The value/size of bar #. Default is 0."},
{"c#_label", "string", "The label for bar #. Default is no label."},
{"c#_style", "{SOLID, STRIPED}", "The style of bar #. Default is SOLID."},
{"c#_color", "{RED, GREEN, BLUE, PINK, ORANGE, MAGENTA, CYAN, WHITE, YELLOW, GRAY, DARKGRAY}", "The color of bar #. Default is GRAY."}
};
return info;
}
}
Was This Post Helpful? 0
  • +
  • -

#9 anum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-November 08

Re: copilation error

Posted 14 December 2008 - 04:23 AM

View PostBigAnt, on 13 Dec, 2008 - 10:07 AM, said:

What do you type in when you try to run the program?



i type
javac prgrmname.java
for compilation

nd to run my program i use
programname.java

nd i use jdk1.2.2 wth kawapro5.0
nd i run most of programs in kawa..
plz help me..
shuld i instal some other version..
or plz tell me step by step procedure 4r instalation of java
Was This Post Helpful? 0
  • +
  • -

#10 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 101
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: copilation error

Posted 14 December 2008 - 11:33 AM

Quote

nd to run my program i use
programname.java



To run the program you must type:
java programname

This is assuming that you are in the directory containing the compiled bytecode and that the class path is appropriately set, which it should be if it compiles like you said.


Also if you are trying to run the program you gave,which is an applet and cannot be run the way I just said, it must be used in a seperate html file.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1