University of Lausanne, Switzerland - Université de Lausanne, Suisse

RunJava

The RunJava Suite by Eric Keller (Eric.Keller@imm.unil.ch)

RunJava.exe

CRJavaApplic.exe
CRJavaApplet.exe
RunJavaApplic.exe
RunJavaApplet.exe

These Windows programs are here for those of us who hate to type and love to double-click, even when running Java applications in a bare bones Windows environment. These programs create short batch files that run the Java compiler (javac.exe) and/or the Java interpreter (java.exe), and/or the appletviewer for Java applications and applets you have written.

To convert a Java application class into a double-clickable executable, take a copy of RunJava.exe, name it what you want, and run it. The first time, it asks you for the name of the application, subsequently you can simply double-click to run your application. This in effect makes double-clickable applications out of your Java applications.

RunJava.exe requires that you have a Java virtual machine called java.exe installed on your computer (check your Windows folder). Generally that means that you have the Java Runtime Environment (JRE) installed somewhere on your machine. If you don't, you can download one via http://java.sun.com/products/jdk/1.2/jre/index.html.

The rest of the programs suppose that in addition, you have an operational Java Development environment on your Windows 95 or 98 machine, and that your paths and classpaths are set up correctly. If this is not the case, you should first download the current Java development kit from http://java.sun.com/products/jdk/ (follow the indications for the current Windows SDK). Once everything is set up correctly, you can run these programs from anywhere on your disk.

L'ensemble RunJava par Eric Keller
(Eric.Keller@imm.unil.ch)

RunJava.exe

CRJavaApplic.exe
CRJavaApplet.exe
RunJavaApplic.exe
RunJavaApplet.exe

Cet ensemble de logiciels Windows est destiné à ceux qui parmi nous, plutôt que taper, préfèrent double-cliquer, même lors de l'exécution des applications Java dans un environnement Windows simple. Ces logiciels créent des petits fichiers batch qui activent le compilateur Java (javac.exe) et/ou l'interpréteur Java (java.exe), et/ou l'appletviewer pour des applications et applets Java que vous auriez créées.

Pour convertir une application Java en logiciel double-cliquable, prenez une copie de RunJava.exe, nommez-la ce que vous désirez, et lancez-la. En effet, ceci rend vos applications Java double-cliquables sous Windows.

RunJava.exe suppose que vous ayez installé une machine virtuelle Java appelée java.exe sur votre ordinateur (vérifiez votre dossier Windows). Ceci suppose généralement que vous ayez installé l'environnement JRE ("Java Runtime Environment") quelque part sur votre machine. Sinon, vous pouvez obtenir une copie de l'environnement JRE via http://java.sun.com/products/jdk/1.2/jre/index.html.

Ces logiciels supposent en sus que vous ayez installé un système de développement fonctionnel sur votre machine Windows 95 ou 98, et que vos chemins (paths et éventuellement classpaths) soient correctement installés. Si ce n'est pas le cas, vous devriez d'abord charger le kit de développement actuel pour Java de http://java.sun.com/products/jdk/ (suivre les indications pour le kit SDK actuel pour Windows). Une fois que tout est installé correctement, vous pouvez exécuter ces logiciels depuis n'importe quel endroit sur votre disque.

What these programs do in detail

CRJavaApplic.exe compiles and runs a Java application (extension *.java)
CRJavaApplet.exe compiles a Java applet and runs it with appletviewer (extension *.java, and an associated *.html file)
RunJavaApplic.exe runs a Java bytecode application (extension *.class)
RunJavaApplet.exe runs a Java applet with appletviewer (extension *.html)

RunJava.exe runs a set Java application without asking the user for a file name more than once (extension *.class)

Specifically: supposing you have a Java application called "TestApplic.java", double-clicking CRJavaApplic.exe is equivalent to creating and running a batch file containing

    javac TestApplic.java
    java TestApplic

Or: supposing you have a Java applet called "TestApplet.java", double-clicking CRJavaApplet.exe is equivalent to creating and running a batch file containing

    javac TestApplet.java
    appletviewer TestApplet.html

RunJavaApplic.exe and RunJavaApplet.exe leave out the first line for compilation and just run java or appletviewer.

All these programs, except for RunJava.exe, ask the user for a file name.

RunJava.exe asks only once, stores the name in a file called "AppName.txt", and henceforth executes the application without asking the user. You can rename RunJava.exe what you want, e.g., RunMyVeryOwnAppl.exe. Simply delete the file "AppName.txt" if you want to have the program run another Java application.

After use, the batch files are removed.

Just to make things even easier on us double-clickers, the programs create a text file "LastClassPath.txt" which stores the last folder from which you launched a Java program.

En détail

CRJavaApplic.exe compile et exécute une application Java (extension *.java)
CRJavaApplet.exe compile et exécute une applet Java et l'exécute au moyen d'appletviewer (extension *.java, et fichier *.html associé)
RunJavaApplic.exe exécute une application bytecode Java (extension *.class)
RunJavaApplet.exe exécute une applet Java au moyen d'appletviewer (extension *.html)

RunJava.exe exécute une application Java sans demander le nom du fichier plus d'une fois (extension *.class)

Spécifiquement: en supposant que vous ayez une application Java appelée "TestApplic.java", un double-clic sur CRJavaApplic.exe créera et exécutera un fichier batch contenant

    javac TestApplic.java
    java TestApplic

Ou: en supposant que vous ayez une applet appelée "TestApplet.java", un double-clic sur CRJavaApplet.exe créera et exécutera un fichier batch contenant

    javac TestApplet.java
    appletviewer TestApplet.html

RunJavaApplic.exe et RunJavaApplet.exe ôtent la première ligne de compilation, et ne font qu'exécuter java ou appletviewer.

Tous ces logiciels, sauf pour RunJava.exe, demandent un nom de fichier à l'utilisateur.

RunJava.exe ne demande le nom qu'une seule fois, le stocke dans un fichier appelé "AppName.txt", et exécute l'application dorénavant sans plus demander le nom à l'utilisateur. Vous pouvez le renommer ce que vous souhaitez, p.ex., LanceMaPropreAppJava.exe. Si vous souhaitez que le logiciel exécute une autre application, effacez simplement le fichier "AppName.txt".

Après utilisation, les fichiers batch sont effacés.

Pour rendre la vie encore plus simple aux double-cliqueurs, le logiciel crée un fichier texte appelé "LastClassPath.txt" dont la fonction est de stocker le dernier dossier à partir duquel vous avez lancé un programme Java.

FAQ 1: Why do you create and run a batch file? Why not launch the process directly from the *.exe file?

At least in my experience, a spawned process exits as soon as it is over. When you're running Java application that writes to the DOS monitor, the monitor window closes as soon as the Java application is done. This means that you can't see what the application wrote in the window. Running a batch file gets around this problem.

FAQ 1: Pourquoi créer et exécuter un fichier batch? Pourquoi pas lancer le processus directement à partir du logiciel *.exe?

Dans mon expérience, un processus de ce type quitte aussitôt qu'il a terminé son travail. Quand on fait exécuter des applications Java qui écrivent sur la fenêtre du moniteur DOS, la fenêtre du moniteur ferme aussitôt que l'application Java a terminé. Par conséquent, vous ne voyez pas ce que l'application a écrit dans la fenêtre. Ce problème est contourné en lançant un fichier batch.

Legalese

These programs are free of charge, but they are Copyright © 2000 University of Lausanne, Switzerland.

No further documentation exists (or seems needed). No guarantees or warranties are made on these products. If you reside in an area which does not permit the use or distribution of free products without guarantee or warranty, you are invited not to download this product.

This suite of programs has only been tested on a Windows 98 system.

Enjoy and type less.

Matières légales

Ces logiciels sont gratuits, mais ils sont Copyright © 2000, Université de Lausanne, Suisse.

Aucune autre documentation existe (ou semble nécessaire). Aucune garantie n'est faite pour ces produits. Si vous résidez dans une législation qui exclut l'utilisation ou la distribution de produits gratuits sans garantie, vous êtes invité à ne pas charger ce produit.

L'ensemble de ces logiciels n'a été testé que sur un système Windows 98.

Pour votre appréciation et pour moins taper.