Compiling at DOS prompt?
When compiling at the DOS prompt one gets an error because one can only use 3 letter extensions unlike what is needed for "javac simple.java" and "java simple.class"
One does? I suppose if you had DOS 6.0 without Windows you would have this problem... is that what you have?
Similar Messages
-
How to Compile this prog. i DOS prompt.
Hey Friends,
I don't know how to compile this prog. on DOS prompt, kindly tell.
// My Java Prog.
package package1;
import java.awt.Graphics;
import java.lang.Number;
import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.Color;
import java.awt.event.*;
import java.applet.Applet;
import java.io.*;
import java.util.*;
import java.Applet.*;
/* <applet code="abc" width=600 height=1000 > </applet> */
public class abc extends Applet implements Runnable {
Hashtable dataFile = new Hashtable();
StringBuffer sb;
String Date,Time,Freq;
double KarDmd,KarDwl,KarShr,KarGen;
boolean flag = true ;
Thread myThread = null;
* init
public void init(){
setBackground(Color.gray);
* start
public void start() {
System.out.println("Start called"+this.getDocumentBase());
System.out.println("Start called"+this.getCodeBase());
myThread = new Thread(this );
myThread.start();
}//close thread
public void run(){
while (flag){
try {
URL url = new URL(this.getCodeBase(),"servlet/FileReadingServlet");
HttpMessage message = new HttpMessage(url);
InputStream in = message.sendGetMesage(null);
ObjectInputStream ois = new ObjectInputStream(in);
//String readStream = (String)ois.readObject();
dataFile = (Hashtable)ois.readObject();
//sb = new StringBuffer(readStream);
System.out.println("Applet Read :"+dataFile);
this.repaint();
try {
Thread.sleep(10000);
}catch (InterruptedException io){}
}catch (Exception e){
e.printStackTrace();
flag = false;
}//while
}//close run
public void paint (Graphics g){
g.clearRect(0,0,700,450);
g.drawString("Date :", 500,16);
g.drawString((String)dataFile.get("DATE"), 550,16);
g.drawString("TIME:",500,32);
g.drawString((String)dataFile.get("TIME"), 550,32);
g.drawString("FREQ :",500,48);
g.drawString((String)dataFile.get("FREQ"), 550,48);
// "KARNATAKA"
g.setColor(Color.cyan);
g.drawRect(10,50,150,100);
g.fillRect(10,50,150,100);
g.setColor(Color.black);
g.drawString("KARNATAKA",25,65);
g.drawLine(160,100,250,100);
g.drawString("GENERATION ",12,87);
String KAR_GEN = this.getGeneration((String)dataFile.get("KAR_DMD"),
(String)dataFile.get("KAR_DRL"));
g.drawString(KAR_GEN ,120,87);
g.drawString("SCHEDULE",12,107);
g.drawString((String)dataFile.get("KAR_SHD"),120,107);
g.drawString("DRAWL ",12,127);
g.drawString((String)dataFile.get("KAR_DRL"),120,127);
g.drawString("DEMAND ",12,147);
g.drawString((String)dataFile.get("KAR_DMD"),120,147);
g.drawLine(92,70,92,150);
//"KAPS"
g.setColor(Color.green);
g.drawRect(12,5,85,30);
g.fillRect(12,5,85,30);
g.setColor(Color.black);
g.drawString("KAPS",14,20);
g.drawString("DEMAND:",14,35);
g.drawString((String)dataFile.get("KAPS_DMD"),70,35);
//"GOA"
g.setColor(Color.magenta);
g.drawRect(100,5,85,30);
g.fillRect(100,5,85,30);
g.setColor(Color.black);
g.drawString("GOA",104,20);
g.drawString("DEMAND:", 104,35);
g.drawString((String)dataFile.get("GOA_DMD"),160,35);
// "ANDHRA PRADESH"
g.setColor(Color.orange);
g.drawRect(250,50,150,100);
g.fillRect(250,50,150,100);
g.setColor(Color.black);
g.drawLine(32,37,32,50);
g.drawLine(110,35,110,50);
g.drawString("ANDHRA PRADESH",268,65);
g.drawString("GENERATION ",252,87);
String AP_GEN = this.getGeneration((String)dataFile.get("AP_DMD"),
(String)dataFile.get("AP_DRL"));
g.drawString(AP_GEN,350,87);
g.drawString("SCHEDULE",252,107);
g.drawString((String)dataFile.get("AP_SHD"),350,107);
g.drawString("DRAWL",252,127);
g.drawString((String)dataFile.get("AP_DRL"),350,127);
g.drawString("DEMAND",252,147);
g.drawString((String)dataFile.get("AP_DMD"),350,147);
g.drawLine(332,70,332,150);
// "NTPC"
g.setColor(Color.pink);
g.drawRect(250,3,85,30);
g.fillRect(250,3,85,30);
g.setColor(Color.black);
g.drawString("NTPC",252,14);
g.drawString("DEMAND:",252,30);
g.drawString((String)dataFile.get("NTPC_DMD"),305,30);
//"HVDC"
g.setColor(Color.green);
g.drawRect(350,3,85,30);
g.fillRect(350,3,85,30);
g.setColor(Color.black);
g.drawString("HVDC",352,14);
g.drawString("DEMAND:",352,30);
g.drawString((String)dataFile.get("HVDC_DMD"),405,30);
//"GAUZACK"
g.setColor(Color.magenta);
g.drawRect(450,80,90,30);
g.fillRect(450,80,90,30);
g.setColor(Color.black);
g.drawString("GAZ",452,90);
g.drawString("DEMAND:",452,105);
g.drawString((String)dataFile.get("GAZ_DMD"),510,105);
g.drawLine(160,250,250,250);
g.drawLine(85,150,85,200);
g.drawLine(160,125,250,225);
g.drawLine(270,300,270,330);
g.drawLine(370,300,370,330);
g.drawLine(400,230,450,230);
g.drawLine(400,100,450,100);
g.drawLine(270,33,270,50);
g.drawLine(370,33,370,50);
//"KERALA"
g.setColor(Color.green);
g.drawRect(10,200,150,100);
g.fillRect(10,200,150,100);
g.setColor(Color.black);
g.drawString("KERALA",62,215);
g.drawString("GENERATION ",12,237);
String KER_GEN = this.getGeneration((String)dataFile.get("KER_DMD"),
(String)dataFile.get("KER_DRL"));
g.drawString((String)dataFile.get("KER_GEN"),120,237);
g.drawString("SCHEDULE ",12,257);
g.drawString((String)dataFile.get("KER_SHD"),120,257);
g.drawString("DRAWL",12,277);
g.drawString((String)dataFile.get("KER_DRL"),120,277);
g.drawString("DEMAND",12,297);
g.drawString((String)dataFile.get("KER_DMD"),120,297);
//"TAMIL NADU"
g.drawLine(92,220,92,300);
g.drawLine(325,150,325,200);
g.setColor(Color.yellow);
g.drawRect(250,200,150,100);
g.fillRect(250,200,150,100);
g.setColor(Color.black);
g.drawString("TAMIL NADU",272,215);
g.drawString("GENERATION ",252,237);
String TN_GEN = this.getGeneration((String)dataFile.get("TN_DMD"),
(String)dataFile.get("TN_DRL"));
g.drawString((String)dataFile.get("TN_GEN"),350,237);
g.drawString("SCHEDULE ",252,257);
g.drawString((String)dataFile.get("TN_SHD"),350,257);
g.drawString("DRAWL ",252,277);
g.drawString((String)dataFile.get("TN_DRL"),350,277);
g.drawString("DEMAND:",252,297);
g.drawString((String)dataFile.get("TN_DMD"),350,297);
g.drawLine(332,220,332,300);
// "PONDYCHERRY"
g.setColor(Color.magenta);
g.drawRect(450,220,90,30);
g.fillRect(450,220,90,30);
g.setColor(Color.black);
g.drawString("PDY",452,230);
g.drawString("DEMAND:",452,245);
g.drawString((String)dataFile.get("PDY_DMD"),510,245);
//"NLY"
g.setColor(Color.green);
g.drawRect(250,330,90,30);
g.fillRect(250,330,90,30);
g.setColor(Color.black);
g.drawString("NLY",252,340);
g.drawString("DEMAND:",252,355);
g.drawString((String)dataFile.get("NLY_DMD"),310,355);
//"MAPS"
g.setColor(Color.pink);
g.drawRect(350,330,90,30);
g.fillRect(350,330,90,30);
g.setColor(Color.black);
g.drawString("MAPS",352,340);
g.drawString("DEMAND:",352,355);
g.drawString((String)dataFile.get("MAPS_DMD"),410,355);
g.setColor(Color.black);
//g.drawLine(440,306,620,306);
//g.drawLine(440,332,620,332);
//g.drawLine(440,358,620,358);
//g.drawLine(530,280,530,388);
for(int i=70;i<150;i=i+20) g.drawLine(10,i,160,i);
for(int i=70;i<150;i=i+20) g.drawLine(250,i,400,i);
for(int i=220;i<300;i=i+20) g.drawLine(10,i,160,i);
for(int i=220;i<300;i=i+20) g.drawLine(250,i,400,i); }//close paint
* stop
public void stop() {
myThread.destroy();
* destroy
public void destroy() {
* getAppletInfo
* @return java.lang.String
public String getAppletInfo() {
return "Applet Information";
private String getGeneration(String DMD,String DRL){
double _gen = 0;
if ( ( DMD != null) && ( DRL != null)){
Double DMDOB = new Double(DMD);
Double DRLOB = new Double(DRL);
gen = DMDOB.doubleValue() - _DRLOB.doubleValue();
return new Double (_gen).toString();
} //close classChange your directory to the directory above package1.
Assuming that you've got d:/projects/src/package1/abc.java you'd want to be in d:/projects/src.
Run javac referencing the abc class relatively:
d:\projects\src> javac package1/abc.javaThis should get you abc.class in the package1 directory.
Hope this helps. -
Error when running mortgage calc program from DOS prompt
I have a GUI Mortgage Calculator program. It probably isn't the most efficient use of code, but it gets the job done. I am running java SDK 1.6.0_06. This is a class assignment. We are to compile the code and post the .class file for our team members to run. I am trying to get the .class file to run after I compile it with javac. I used jCreator LE to create it... it compiles and runs there just fine. The program will compile at the DOS prompt, but will not run properly. The following is the error I get (any help would be appreciated):
Exception in thread "mani" java.lang.NoClassDefFoundError: manchorMortgage3
Caused by: java.lang.ClassNotFoundException: manchorMortgage3
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader1.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Below is my code:
* manchorMortgage3.java
* Created on July 10, 2008
* This program calculates and displays the mortgage amount
* from user input of the amount of the mortgage and the user's
* selection from a menu of available mortgage loans.
import java.math.*; //*loan calculator
import java.text.*; //*formats numbers
import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class manchorMortgage3 extends javax.swing.JFrame {
/** Creates new form manchorMortgage3 */
public manchorMortgage3() {
initComponents();
setLocation(300,200);
/** This method is called from within the constructor to
* initialize the form.
// Begin Initialize Components
private void initComponents() {
mortgageAmount = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
termAndInterest = new javax.swing.JLabel();
jRadioButton1 = new javax.swing.JRadioButton();
jRadioButton2 = new javax.swing.JRadioButton();
jRadioButton3 = new javax.swing.JRadioButton();
calcButton = new javax.swing.JButton();
enterAmount = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Manchor - Mortgage Calculator - Week 3");
mortgageAmount.setText("Enter the Mortgage Amount:");
termAndInterest.setText("Select Your Term and Interest Rate:");
jRadioButton1.setText("7 years at 5.35%");
jRadioButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton1.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton1ActionPerformed(evt);
jRadioButton2.setText("15 years at 5.5%");
jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton2ActionPerformed(evt);
jRadioButton3.setText("30 years at 5.75%");
jRadioButton3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton3.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton3ActionPerformed(evt);
calcButton.setText("Calculate");
calcButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
calcButtonActionPerformed(evt);
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jButton2.setText("Quit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(enterAmount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 222, Short.MAX_VALUE)
.addComponent(calcButton)
.addGap(75, 75, 75))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jRadioButton3)
.addComponent(jRadioButton2)
.addComponent(jRadioButton1)
.addComponent(termAndInterest)
.addComponent(mortgageAmount)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(224, Short.MAX_VALUE)))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(277, Short.MAX_VALUE)
.addComponent(jButton2)
.addGap(70, 70, 70))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(mortgageAmount)
.addGap(14, 14, 14)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20)
.addComponent(termAndInterest)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRadioButton1)
.addGap(15, 15, 15)
.addComponent(jRadioButton2)
.addGap(19, 19, 19)
.addComponent(jRadioButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(calcButton)
.addComponent(enterAmount))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addGap(20, 20, 20))
pack();
}// End initialize components
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//event_jButton2ActionPerformed
System.exit(1);
}//event_jButton2ActionPerformed
static NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);
static NumberFormat np = NumberFormat.getPercentInstance();
static NumberFormat ni = NumberFormat.getIntegerInstance();
static BufferedReader br;
private void calcButtonActionPerformed(java.awt.event.ActionEvent evt) {//event_calcButtonActionPerformed
enterAmount.setText(null);
jTextArea1.setText(null);
double monthlyPayment;
double interest;
double amount ;
int years ;
double monthlyInterest, monthlyPrinciple, principleBalance;
int paymentsRemaining, lineCount;
np.setMinimumFractionDigits(2);
br = new BufferedReader(new InputStreamReader(System.in));
lineCount = 0;
try
amount=Double.parseDouble(jTextField1.getText());
catch (Exception e)
enterAmount.setText("Please Enter Mortgage Amount");
return;
if(jRadioButton1.isSelected())
interest=0.0535;
years=7;
else if(jRadioButton2.isSelected())
interest=0.055;
years=15;
else if(jRadioButton3.isSelected())
interest=0.0575;
years=30;
else
enterAmount.setText("Please Select Your Term and Interest Rate");
return;
jTextArea1.append(" For a mortgage of " + nf.format(amount)+"\n"+" With a Term of " + ni.format(years) + " years"+"\n"+" And an Interest rate of " + np.format(interest)+"\n"+" The Payment Amount is " + nf.format(getMortgagePmt(amount, years, interest)) + " per month."+"\n"+"\n");
principleBalance = amount - ((getMortgagePmt(amount, years, interest)) - (amount*(interest/12)));
paymentsRemaining = 0;
do
monthlyInterest = principleBalance * (interest/12);//*Current monthly interest
monthlyPrinciple = (getMortgagePmt(amount, years, interest)) - monthlyInterest;//*Principal payment each month minus interest
paymentsRemaining = paymentsRemaining + 1;
principleBalance = principleBalance - monthlyPrinciple;//*New balance of loan
jTextArea1.append(" Principal on payment " + ni.format(paymentsRemaining) + " is " + nf.format(monthlyPrinciple)+"\n");
jTextArea1.append(" Interest on payment " + ni.format(paymentsRemaining) + " is " + nf.format(monthlyInterest)+"\n");
jTextArea1.append(" New loan balance on payment " + ni.format(paymentsRemaining) + " is " + nf.format(principleBalance)+"\n"+"\n"+"\n");
while (principleBalance > 1);
}//Begin event_jRadioBtton1Action Performed
public static double getMortgagePmt(double balance, double term, double rate)
double monthlyRate = rate / 12;
double monthlyPayment = (balance * monthlyRate)/(1-Math.pow(1+monthlyRate, - term * 12));
return monthlyPayment;
private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt) {//Begin event_jRadioButton3ActionPerformed
if(jRadioButton2.isSelected())
jRadioButton2.setSelected(false);
if(jRadioButton1.isSelected())
jRadioButton1.setSelected(false);
}//End event_jRadioButton3ActionPerformed
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//Begin event_jRadioButton2ActionPerformed
if(jRadioButton1.isSelected())
jRadioButton1.setSelected(false);
if(jRadioButton3.isSelected())
jRadioButton3.setSelected(false);
}//End event_jRadioButton2ActionPerformed
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
if(jRadioButton2.isSelected())
jRadioButton2.setSelected(false);
if(jRadioButton3.isSelected())
jRadioButton3.setSelected(false);
}//End event_jRadioButton1ActionPerformed
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new manchorMortgage3().setVisible(true);
// Begin variables declaration
private javax.swing.JButton calcButton;
private javax.swing.JButton jButton2;
private javax.swing.JLabel mortgageAmount;
private javax.swing.JLabel termAndInterest;
private javax.swing.JLabel enterAmount;
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton jRadioButton2;
private javax.swing.JRadioButton jRadioButton3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
// End variables declaration
}The class is not in your classpath. Likely you blew away your classpath with some silly environment variable.
If you are in the directory where your class file is then execute
java -cp . manchorMortgage3and it will work. (Note the -cp . which tells java to include the current directory in the runtime classpath) -
Error compiling in DOS while creating uderdefined pakages
well i created 2 folders in my working directory pac1 and pac2 wherein i compiled couple of programs in each folder. when i compile the main prog inmy working directory in dos prompt..its not able 2 open the pac1 folder and execute th reqd classes..also when i extend the classes from one package 2 another..it shows error tht the classes dont exist.how do i solve the prob in dos prompt
Please read [_How To Ask Questions The Smart Way_|http://www.catb.org/~esr/faqs/smart-questions.html].
Especially the parts that ask you to [_Write in clear, grammatical, correctly-spelled language_|http://www.catb.org/~esr/faqs/smart-questions.html#writewell].
Also, telling us how you tried to compile your code and the exact error message you get would help tremendously with finding a solution. -
Error when I execute an application with the java command in a DOS prompt
Hi:
I have a trouble. I edit the most simple program in Java: hello.java
In DOS prompt, I compile the program. The result is the file hello.class
c:\> javac hello.java
However, I try to execute this program with the command java
c:\> java hello
and the DOS prompt send me an error like this: Java.exe has a problem and must be closed.
I press the option "Don't send". After this, the DOS prompt returns empty and it doesnt execute the application:
c:\>
By the way, in an IDE editor like Gel, the file hello.java is compiled and executed correctly without problems.
I edited other simple Java files, I compiled them succesfully and I can't run them in a DOS pormpt. The result is the same dialog box: "Java.exe has a problem and must be closed".
The question is: Why don't these programs run in a DOS prompt?
My Operating System is Microsoft Windows XP and the Java compiler version is: 1.6.0_13
Thanks in advanced.Hi again:
What happens when you type "java -version"?
Answer:
java version "1.2"
Classic VM (build JDK-1.2-V, native threads)
What is the value of your %PATH%?
Answer:
Path=E:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Archivos de programa\Archivos comunes\Adaptec Shared\System;C:\Archivos de programa\Executive Software\DiskeeperLite\;C:\Archivos de programa\QuickTime\QTSystem\;C:\Archivos de programa\Java\jdk1.6.0_13\bin;C:\Archivos de programa\Microsoft SQL Server\80\Tools\Binn\;e:\Microsoft SQL Server\90\Tools\binn\;C:\BITWARE\;C:\Archivos de programa\Archivos comunes\Ahead\Lib\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
Have you considered running Linux?
Answer: No, because Linux is more complex.
Additional information:
My Operating System is: Microsoft Windows XP Profesional Version 2002, Service Pack 3, running on an Intel Pentium 4, CPU 2.4 Ghz, RAM: 2.23 Gb -
Running java command from DOS prompt
Hi,
When I run java from the DOS prompt (NT) in any other location than the JDK bin directory, I get the following error:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment'
My understanding is to be able to run this from anywhere you need to add the tools.jar file to the CLASSPATH, which I have done.
There is no entry in the Registry for Software\JavaSoft...etc, has anyone any idea what my problem is and how I can solve it?
Thanks in advanceHi,
I am running Java 2 SDK, Standard Edition Version 1.2.2 running on NT. It was installed as part of Oracles JDeveloper IDE and is running on NT.
All I want to be able to do is run java from the command line e.g. 'java myclass', to run a standalone Java program. I can run 'javac myclass.java' to compile the program without any problems, but my understanding is that to do this all I need is to have the '.../java1.2/bin' directory included in the 'PATH' variable, whereas to run the java runtime you need to include the tools.jar in the CLASSPATH variable.
As I said previously I can run the 'java myclass' command from the '../java1.2/bin' directory, just not from anywhere else. As for whats in the code, does not matter you should be able to type just java on the command line and it will come back with an error prompting for the class name. Here is an example of what happens:
I:\>java
Error opening registry key 'Software\JavaSoft\Java Runtime Environment'
However if I change to the correct directory, I get:
D:\oracle\JDev32\java1.2\bin>java
Usage: java [-options] class [args...]
(to execute a class)
or java -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
The contents of my PATH and CLASSPATH variable are shown below, Thanks again.
I:\>PATH
PATH=D:\oracle\BIN;D:\oracle\Apache\Perl\5.00503\bin\mswin32-x86;C:\Program Files\Oracle\jre\1.1.7\b
in;D:\oracle\ora8i\bin;C:\DMINT40\Win32\Bin;C:\WINNT\system32;C:\WINNT;C:\Program Files\Symantec\pcA
nywhere;d:\oracle\jdev32\java1.2\bin;d:\downloads\oraxml\bin;d:\oracle\jdev32\java1.2\lib\tools.jar
I:\>echo %CLASSPATH%
d:\oracle\jdev32\java1.2\lib\tools.jar;d:\oracle\apache\apache\htdocs\web-inf\classes;d:\oracle\apac
he\jserv\servlets -
Win2000 NoClassDefFoundError running java.exe from DOS prompt
I am using Windows 2000 with J2SE v 1.3.1_02 and have a problem when I run java.exe from the command line for classes that are defined to be in a package. I can both compile and run this program from the TextPad editor but when I run it from a DOS prompt I get the error "Exception in thread "main" java.lang.NoClassDefFoundError: MyClass"
My CLASSPATH is set to D:\
The files MyClass.java and MyClass.class are in the directory D:\MyProject
here is the source:
package MyProject;
public class MyClass
public static void main(String[] args)
System.out.println("MyClass main");
Note that if I comment out the package statement and add "." to CLASSPATH then it runs from the DOS prompt. Why does the program run from inside TextPad but not from the DOS prompt? Seems to be some type of bug in java.exe on Windows 2000 when the keyword package is used.It turns out that if you use the main method in a class that declares the package statement you need to use the fully qualified name to run the program. Using this statement works for this problem:
java MyProject/MyClass
the forward slash is required even though is a Windows system. -
Can't run java or javac from dos prompt
I just installed j2sdk1.4.1 on win98SE. I have a problem where I can't seem to be able to compile or run an application from the dos prompt. I can do both in Visualage for Java or in JGrasp but not at the DOS Prompt. I have set the PATH statement to PATH=c:\j2dsk1.4.1\bin and the classpath=c:\j2sdk1.4.1\lib. The following is a typical error message:
javac RunApplet.java
RunApplet.java:8: cannot resolve symbol
symbol : class MyApplet
location: class RunApplet
MyApplet myApplet = new MyApplet():
RunApplet..java:8: cannot resolve symbol
symbol : class MyApplet
location: class RunApplet
MyApplet myApplet = new MyApplet()
2 errors
java RunApplet.class
Exception in thread "main" java.lang.NoClassDefFoundError: RunApplet/class
It seems like the system can't locate the class files?
Also is there away to use more than the standard 8.3 charecter set in the DOS prompt window?
TIAjavac RunApplet.java
RunApplet.java:8: cannot resolve symbol
symbol : class MyApplet
location: class RunApplet
MyApplet myApplet = new MyApplet():
RunApplet..java:8: cannot resolve symbol
symbol : class MyApplet
location: class RunApplet
MyApplet myApplet = new MyApplet()
2 errorsMost likely a Classpath problem. I suggest changing your classpath to:
classpath=.;c:\j2sdk1.4.1\lib
java RunApplet.class
Exception in thread "main"
java.lang.NoClassDefFoundError: RunApplet/class2 problems. As ChuckBing says, the command needs to be "java RunApplet" with no .class. The argument to the java command is the class name, not a file name. The second problem - if you do not have a successful compilation, there won't be any .class file to run. -
Executing a JAVA program from a DOS prompt vs the START = RUN dialog
Another novice programmer question...I hope you have the patience...
I have a demo JAVA program that runs fine on my Windows PC when I execute it from a DOS prompt:
K:\COMMON\ITS\STEVEB\java\WhileDemo>java WhileDemo
Count is: 1
Count is: 2
Count is: 3
Count is: 4
Count is: 5
Count is: 6
Count is: 7
Count is: 8
Count is: 9
Count is: 10Can I run this same command from the Windows START => RUN dialog? If I cut an paste the same command, 'K:\COMMON\ITS\STEVEB\java\WhileDemo>java WhileDemo', into the START => RUN dialog I get the following error:
"Windows cannot find 'K:\COMMON\ITS\STEVEB\java\WhileDemo>java WhileDemo'. Make sure you have typed the name correctly, and then try again. To search for a file, click the Start button and then click Search."
Is what I'm attempting to do even possible? Any insights would be greatly appreciated. Thanks.Will a .JAR keep the window from closing on exit? Nope... creating java-archives (jar's) is just the next step down the "how to publish my java application" road. You will eventually (almost certainly) need to progress that far... but there's no rush.
Compiling to and running from class files will do for now.
If you want a command prompt which stays open then open it yourself... Start ~ run: cmd (on NT, XP, Fista)
See also: "cmd here" is one of the windows power toys: http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx -
HI~~
I am new to Java and really need help.
I have a program which requires a file as an argument and the file name should be provided as a command line argument.
In dos prompt, how do I tell computer which file is the input file for the program to take as an argument?
Thank you very much for helping me out.suppose your file in java is Hello.java
Compile it(javac Hello.java) . u get Hello.class
Now suppose your input file is file.txt
So at the command prompt
type
c:\>java Hello file.txt
This will cause the args[0] to be initialised to file.txt
How to use it , u have to figure out.
Regards
Manoj. -
How to run Hello.jaja in MS DOS Prompt ?
Hi, this is my first programming assingment. And i need help on opening the file using MS DOS Prompt.
This is what have done so far in MS DOS Prompt. But, it does not work.
C:\WINDOWS> cd c:\
C:\>cd c:java_rp\lab3\Hello Project\Hello.java
Too many parameters - Project\Hello.java
Help will be appreciated !
Thank YouHello, marc_huhardeaux
I finally got it working. Thanks for you help.
This is what i did:
C:\windows> cd c:\java_rp\Lab3\HelloProject
C:\java_rp\Lab3\HelloProject> java hello
Then i press return. and then it executed correctly.
Hello World
You said to: first use the compilator command : javac hello.java ther type this command to execute it : java hello
I tried using: javac hello.java and nothing happend just got a bad command.
Then i just typed: java hello, then it executed correctly.
Thank You -
How To Boot Windows 7 from Windows 7 DOS Prompt?
I got hit by the GVU virus. Spent a week poking around and made some interesting discoveries!
The GVU virus appears to lock you out of your computer always going to a page in german demanding 100 euros to restore it.
If you reboot while pressing F8 you can get to the debug page which lists several options including boot to DOS prompt.
Select this option.
Windows 7 will boot and ask you to login. Do this.
Your computer will now go to the DOS prompt.
On a second computer I installed an up to date copy of Spybot. Using explorer I found the Spybot directory tree under Program files and copied it to a jump drive.
Remove the jump drive from the second computer and insert it in your sick computer.
On the sick computer you are at the DOS Prompt. Type explorer and press enter.
A window will open similar to windows 7 explorer. Right clicks will not work, but you will find all the usual right click menu items under Files and Edit on the menu bar.
Click View then Refresh to display your jump drive. You may have to do this a couple of times, but your jump drive will appear in the usual spot.
Select the spybot directory on your jump drive and launch spybot. Run a systems scan and delete every thing it finds. Do this step Several times.
Reboot your computer.
Select Boot windows as normal.
It will ask you to login in. Do so.
Your computer will boot to explorer, the version that you saw in step 9.
Press CTL + ALT + Delete then select Task Manager
Task Manager will launch. If you click the process tab you will see only ten or so processes are running.
Click on the applications tab, then in the bottom right corner click on the button New Task.
Type win and press enter.
You will notice that the number of processes will jump to 90 give or take. When CPU use drops to 5% again or there abouts click new task again.
You are now in windows 7 minus the task bar but with networking etc.
Enter a windows program such as Outlook and press enter. Outlook will boot and run perfectly. I suspect that most windows programs will also run perfectly.
I know if you boot from your windows 7 DVD you can repair your system to normal. My question is can I do this without the disk? At this point I can do all my usual tasks, just without the convenience of the task bar and start button. I
am in the middle of unpacking from a move, cannn't find my Windows 7 install disk. I am so close to getting this computer back to running normally but I am not sure what to do next. Can someone help?
Bob JonesHi,
If you system files are corrupted, we can use SFC to fix missing and corrupted system file:
http://support.microsoft.com/kb/929833/en-us
this could be performed in command prompt mode.
If you have any feedback on our support, please click
here
Alex Zhao
TechNet Community Support -
Have been struggling for days trying to get into the itunes store. Have contacted support with no help. I have been reading how some have typed something into a DOS prompt and have resolved their issues. One stated to "search cmd, right click, and run as admininstrator" but where is this? There was also a post about typing something into the DOS prompt....how do I get to this? Can someone please help??? SOOOOO FRUSTRATING. Thanks much...Carrie (Mike's wife:))
One stated to "search cmd, right click, and run as admininstrator" but where is this?
In the search field in your Vista start menu, type cmd
Next, right-click on the cmd that comes up and select "Run as administrator". -
Converting multiple bmp files to PDF using acrobat 7.0 from DOS prompt
Hi,
I have a requirement to convert multiple BMP files in a folder to one PDF.
I can use multiple file conversion option in acrobat to combine and convert them to one PDF .. but I have 2000 such folder to conver to PDF.
PDF should be name after the folder name.
Is there a to automate this in acrobat.. or can we run this conversion from DOS prompt using commands.. so that I can create a bat file and have them converted. Pls let me know.
Thanks
PugazhI have not tried BMP files, but do JPeg, GIF, TIFF, and PNG files regularly. I simply open Acrobat, then select the graphics files in explorer and drag & drop to Acrobat. I then organize the graphics if needed (using the pages tab) and save to a PDF.
-
Oracle 9i OEM fails using RMAN but RMAN Okay from DOS Prompt
I am using Oracle 9i Enterprise on Windows NT 4 with dual 400 MHZ Pentiums with 1GB of ram. I am able to run RMAN from the DOS prompt and the backup file is created fine. When I run either by a job or by using the Backup wizard from the OEM, the job fails with a TNS:protocol adapter error from the target database.
Error Message that I get is as follow:
Recovery Manager: Release 9.0.1.1.1 - Production
(c) Copyright 2001 Oracle Corporation. All rights reserved.
RMAN> connect target jungle/gonzo@(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=ORACLE)(ARGV0=ORACLEDEV)
(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))
2> connect catalog RMAN/rman@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=testhost.crane.navy.mil)(PORT=1521)))(CONNECT_DATA=(SID=TestOEM)(SERVER=DEDICATED)))
3> @E:/oracle/ora90/work/706143955.21
4> run{allocate channel c1 type disk;
5> backup database format 'F:\OracleDumps\%u';
6> release channel c1;
7> }
8> **end-of-file**
9>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00579: the following error occurred at 06/21/2002 14:39:57
RMAN-04005: error from target database: ORA-12560: TNS:protocol adapter error
Recovery Manager complete.
child process exited abnormally
nms-915: The Job failed, error code=
My TNSnames.ora contents are as follows:
# TNSNAMES.ORA Network Configuration File: c:\oracle\ora90\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
Test.CRANE.NAVY.MIL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.crane.navy.mil)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = Test)
TESTOEM.CRANE.NAVY.MIL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Testhost.crane.navy.mil)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = TESTOEM)
My Listener.ora file is as follows:
# LISTENER.ORA Network Configuration File: c:\oracle\ora90\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 164.227.54.52)(PORT = 1521))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Test)
(ORACLE_HOME = E:\oracle\ora90)
(SID_NAME = Dev)
(SID_DESC =
(GLOBAL_DBNAME = TestOEM)
(ORACLE_HOME = E:\oracle\ora90)
(SID_NAME = DEVOEM)
(SID_DESC =
(PROGRAM = extproc)
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\ora90)
(SID_DESC =
(GLOBAL_DBNAME = SQLSRV_testhost.crane.navy.mil)
(PROGRAM = tg4msql)
(SID_NAME = test1)
(ORACLE_HOME = E:\oracle\ora90)
I believe the problem is with the TNSNames file not having BEQ set up in it. I tried to set up using the Oracle Net Manager and could not find BEQ as an available protocol. Anyone know where to direct me to look in the documentation or can give me some help.
I am a newbie on the Oracle DBA scene and any help would be appreciated. Just been trying to do this since January.Gordon,
Considering that this is a military server I would not post the logon information and server address on a public forum such as this :)
If you are getting the TNS error when submitting the job via OEM, then check that your local tnsnames.ora file on the OEM machine has the tnsnames alias to connect to the target database. When issuing RMAN backups via DOS on the target server you are using BEQ. However, when issuing commands via OEM, you will be using the tnsnames.ora file on the monitoring machine that you've installed OEM on. You will need the tnsnames alias for the RMAN catalog on the target server.
try the following:
set up a tnsnames alias for the target database on the OEM server
open up DOS on the OEM server and type:
rman target jungle/gonzo@<target_database> connect catalog RMAN/[email protected]
Is the target database,catalog and OEM server all on different machines?
Maybe you are looking for
-
Podcast doesn't update on itunes
I have created a video podcast for my family to download videos that I have posted. They have been able to double click on the default rss button to load the feed into itunes. However, itunes does not update the rss feed. I have even tried to reimpor
-
Can Time Capsule replace my old wireless router?
I would like to use time capsule as my router. But when I plug it straight into the phone line, I lose the internet connection. Can this be done?
-
Convert LiveCycle Designer Filleable Form to Web-based Form??
I have a fillable form that was created from scratch using LiveCycle Designer, and I'd like to convert it to a web-based form which I can then post on my website and email the link to others. Is it possible to convert a fillable form to a web-based f
-
N70 phonebook numbers in messages
I have got a Nokia N70, yesterday out of no-where the sms/mms messages i recieved weren't picking up the contacts name in the phone book. I.E when receiving a text message, at first glance it would look like the sender was someone NOT in my phonebook
-
Unable to access internet on initial setup (Macbook)
My internet service was activated yesterday and after following all the steps in the guidebook I was able to find my wireless network and enter in the password. It is showing that I am connected with full service however I have absolutely no access