by Michael Thomas
If you have trouble with any of the steps below see the table below called "Help Notes".
rem Optional:
rem * This is not needed if you set the JAVA_HOME and PATH system environment variables as in the tutorial.
rem call MyFirst_jdk_setpath.bat
echo off
echo.
echo **** Test for: java.exe (Run Java Applications)****
echo.
java.exe -fullversion
echo.
echo **** Test for: javac.exe (Compliler) ****
echo.
javac.exe -help
echo.
echo **** Test for: javaw.exe (Run Java Applications)****
echo.
javaw.exe -help
echo.
echo **** Test for: appletviewer.exe (Compliler) ****
echo.
appletviewer -help
pause
'javac.exe' is not recognized as an internal or external command,
operable program or batch file.
rem **********************
rem Note
rem **********************
rem On your personal PC system environment variables as in the tutorial instructions:
rem * JAVA_HOME
rem * PATH - add %JAVA_HOME%\bin
rem Other Option:
rem * Manually set the path. Just uncomment the line below.
rem path=%path%;"c:\_data\java\jdk1.8.0_111\bin"
/*
File.......: MyHello_Application.java
Description: Basic Application example.
Programmer.: Michael Thomas, 1/17/99
Compile....: javac MyHello_Application.java
Run........: java MyHello_Application
*/
public class MyFirstApplication {
public static void main( String [] args ) {
System.out.println("Hello World from an Application.");
}
}
rem call MyFirst_jdk_setpath.bat
javac MyFirstApplication.java -classpath .
pause
rem call MyFirst_jdk_setpath.bat
java MyFirstApplication
pause
/*
File.......: MyHello_Applet.java
Description: Basic Applet example. (Run by a browser.)
Programmer.: Michael Thomas
Date.......: 1/17/99
Compile....: Myjavac Hello_Applet.java -d bin (dir .\bin)
Run........: Internet Browser or appletviewer Hello_Applet.html
*/
import java.applet.Applet;
import java.awt.Graphics;
public class MyFirstApplet extends Applet {
public void paint(Graphics g) {
g.drawString("Hello World from an Applet. (MyFirstApplet.java)",25,25);
}
}
rem call MyFirst_jdk_setpath.bat
javac MyFirstApplet.java
pause
<html>
<head>
<title>Hello World - Applet only</title>
<link rel="stylesheet" type="text/css" href="logofiles/stylesheet_webtutorials.css">
</head>
<body>
<h1 align="center">Hello World - Applet</h1>
<hr align="center">
<p align="center">
<applet code="MyFirstApplet.class" align="baseline" width="300" height="55">
</applet>
</p>
<hr align="center">
</body>
</html>
rem call MyFirst_jdk_setpath.bat
appletviewer MyFirstApplet.html
pause
Topic | Notes | ||||||||||||||||||||||||||
Environment Variables:
|
DOS Environments:
View the DOS Environment Variables.
Changing the DOS Environment Variables.
DOS Variables: path & CLASSPATH
General Notes - Environment Variables:
Win XP
WinNT (NT4.0 & NT2000)
Win 95/98
Win ME
|
||||||||||||||||||||||||||
CLASSPATH variable | CLASSPATH - | ||||||||||||||||||||||||||
Goto a DOS prompt | Ways to get to a DOS prompt:
|
||||||||||||||||||||||||||
DOS Commands |
Common DOS Commands
www.easydos.com - Helpful info on DOS commands. |
||||||||||||||||||||||||||
Dos Filenames | DOS (some OS versions)
|
||||||||||||||||||||||||||
Errors | Common Errors & Solutions
|