bluejay Posted January 21, 2021 Share Posted January 21, 2021 After a very complicated process, I managed to install JRE 1.1.6 on my Compaq LTE 5250, to try and run an old version of ADTpro on it. I ended up with 3 executables; jre.exe, jrew.exe, and rmiregistry.exe. These are all DOS executables, and the MS-DOS popup window shows up when I click on jre.exe and rmiregistryexe. I read the README it came with and apparently jrew is just jre but without the popup window when launched in Windows. The popup window goes away after a very short period of time, and I can just barely see that it's a list of switches. Okay, so maybe it needs to be run in DOS mode, but nope. When I tried that it says I need to launch it in Windows. So, what do I do now? Quote Link to comment Share on other sites More sharing options...
wierd_w Posted January 21, 2021 Share Posted January 21, 2021 With windows running: Click the start button. Choose run Type "command.com" in the run box. This will spawn a dos shell window. This is distinct from an actual dos session because WOW is running, and various services can be called from the virtual dos shell environment that cannot be called in real dos. This ancient version of JAVA makes use of those services, so it can get access to virtual memory and pals. Use it to invoke the executable. It will let your command line switches stay in the window for you to read. Normally, you call the runtime interpreter with the -jar switch, and pass it the name of the java jar file you want to run. 1 Quote Link to comment Share on other sites More sharing options...
bluejay Posted January 21, 2021 Author Share Posted January 21, 2021 Thanks, that worked, except for the last bit- -jar isn't a valid switch. I'm only given these: What do I need to do to now? I tried jre <filename>.jar and got the error message Class not found: <filename>.jar. I tried using -classpath and entering the path of the file, but still got the same error when I tried it again. Quote Link to comment Share on other sites More sharing options...
wierd_w Posted January 22, 2021 Share Posted January 22, 2021 (edited) Just try the -jar option anyway. The worst that will happen is it says unknown argument or something. If push comes to shove, you can extract the .jar into a folder, read the manifest file for the main class file, then invoke on that class file on the extracted archive. Edited January 22, 2021 by wierd_w Quote Link to comment Share on other sites More sharing options...
bluejay Posted January 22, 2021 Author Share Posted January 22, 2021 I forgot to mention that I already tried and it didn't work. At this point I'm installing Windows 95 OSR2.5 and a newer version of Java. Lets see if that version has the -jar switch. Quote Link to comment Share on other sites More sharing options...
zzip Posted January 22, 2021 Share Posted January 22, 2021 (edited) Sometimes it will take a jar on the command line without the -jar flag. Also I remember in the old days of Java, it was common to put your jars in your CLASSPATH, and call the main class from the command line like "java MyProgram" Edited January 22, 2021 by zzip fixed case Quote Link to comment Share on other sites More sharing options...
bluejay Posted January 22, 2021 Author Share Posted January 22, 2021 39 minutes ago, zzip said: Sometimes it will take a jar on the command line without the -jar flag. Also I remember in the old days of Java, it was common to put your jars in your CLASSPATH, and call the main class from the command line like "java MyProgram" What if you had multiple files in your classpath? Or could you have just one in your classpath at any given time? I tried using it once but I probably did it wrong; maybe I'll try it again properly. Quote Link to comment Share on other sites More sharing options...
zzip Posted January 22, 2021 Share Posted January 22, 2021 6 minutes ago, bluejay said: What if you had multiple files in your classpath? Or could you have just one in your classpath at any given time? I tried using it once but I probably did it wrong; maybe I'll try it again properly. It's similar to PATH, you can have multiple files, or directories separated by a semicolon on Windows or colon on Linux. You have to make sure you append to it, and not overwrite it when you set it, like set CLASSPATH = "%CLASSPATH%; C:\path\to\myjar.jar" (I think that's the syntax on Windows) JAR files are archive files, so you would name the jar file explicitly in the CLASSPATH, if you put a directory in the CLASSPATH, then Java will expect to find .class files in them. Hopefully that makes sense? 1 Quote Link to comment Share on other sites More sharing options...
bluejay Posted January 22, 2021 Author Share Posted January 22, 2021 5 minutes ago, zzip said: It's similar to PATH, you can have multiple files, or directories separated by a semicolon on Windows or colon on Linux. You have to make sure you append to it, and not overwrite it when you set it, like set CLASSPATH = "%CLASSPATH%; C:\path\to\myjar.jar" (I think that's the syntax on Windows) JAR files are archive files, so you would name the jar file explicitly in the CLASSPATH, if you put a directory in the CLASSPATH, then Java will expect to find .class files in them. Hopefully that makes sense? It does. Interestingly enough, everything is integrated into switches on jre.exe. So what I would have to do is jre -CLASSPATH = "%CLASSPATH%; C:\path\to\myjar.jar" or something of the sort. %CLASSPATH% is a name that I can change, right? Can I change the C:\path\to\myjar.jar to whatever directory I like? And to run the .jar contained in the classpath I'd have to do something like jre %CLASSPATH%? Quote Link to comment Share on other sites More sharing options...
zzip Posted January 22, 2021 Share Posted January 22, 2021 1 minute ago, bluejay said: It does. Interestingly enough, everything is integrated into switches on jre.exe. So what I would have to do is jre -CLASSPATH = "%CLASSPATH%; C:\path\to\myjar.jar" or something of the sort. %CLASSPATH% is a name that I can change, right? Can I change the C:\path\to\myjar.jar to whatever directory I like? And to run the .jar contained in the classpath I'd have to do something like jre %CLASSPATH%? I'm not sure if the -CLASSPATH flag appends to the classpath or overwrites it, JAVA typically has some classpath entries for its own use, so you want to make sure those are still included. The Jar file can be placed whereever you like and you can add an absolute or relative path to it in the CLASSPATH Also a JAR is not really a file that you run directly, it's more like a ZIP file that contains a directory of files inside. I believe if it has a method called "Main" it will run that automatically, otherwise you will need to tell it which method to launch You might have a command called "jar" that you can use to list the contents of the jar the syntax would be something like this jar tvf myjar.jar I also want to apologize ahead of time, this is very old version of JAVA and some things have changed, so I might confuse some things. 1 Quote Link to comment Share on other sites More sharing options...
bluejay Posted January 22, 2021 Author Share Posted January 22, 2021 1 minute ago, zzip said: I'm not sure if the -CLASSPATH flag appends to the classpath or overwrites it, JAVA typically has some classpath entries for its own use, so you want to make sure those are still included. The Jar file can be placed whereever you like and you can add an absolute or relative path to it in the CLASSPATH Also a JAR is not really a file that you run directly, it's more like a ZIP file that contains a directory of files inside. I believe if it has a method called "Main" it will run that automatically, otherwise you will need to tell it which method to launch You might have a command called "jar" that you can use to list the contents of the jar the syntax would be something like this jar tvf myjar.jar I also want to apologize ahead of time, this is very old version of JAVA and some things have changed, so I might confuse some things. No, no need to apologize. I'm completely new to these things, so need to thank you for teaching me at least something. I already tried extracting the jar file, but I havent looked into it in detail yet. I'll try setting the classpath and everything in a bit though. Quote Link to comment Share on other sites More sharing options...
zzip Posted January 22, 2021 Share Posted January 22, 2021 3 minutes ago, bluejay said: No, no need to apologize. I'm completely new to these things, so need to thank you for teaching me at least something. I already tried extracting the jar file, but I havent looked into it in detail yet. I'll try setting the classpath and everything in a bit though. Yeah, also most modern Java applications ship with a bat file or shell script that does the messy stuff of setting the classpath for you. doing it by hand was always messy and error prone. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.