Reputation: 11
I made a simple text based game that runs on my computer, but my schools computers have an older version of java and can't run it. I tried compiling the .java
file in from the computers command prompt but I can't access where the javac
folder is to compile because the school computer blocks everything. The command prompt is even disabled by the administrator unless I open it with a batch file. I tried wrapping the jar with the JRE in Launch4j but the exe does nothing, it loads and that's it, nothing comes up (I think it's because the text game is supposed to run in the command prompt so there is no GUI to print any of the text)
How to get a Java program to run on a computer without modern JRE?
Upvotes: 0
Views: 1256
Reputation: 6439
You are running into a bit of a contradiction here; Please take notice on what exactly you are asking:
"How can I run a Java Program without Java?"
Do you get it? You are basically asking "How can I drive a car without the car?"
As for the actual problem, all hope is not lost. Here are some options:
If possible by any means, simply install the latest stable version of Java on the machine.
From a computer that has JRE/JDK installed (or through another form of access to the JavaCompiler, AKA JavaC
), recompile the code to the older version of Java using the command-line parameters for source
and target
java versions (Note: I am unsure if the JRE/JDK for the older version must be installed in the machine or not).
For this case, you might want to take a look at this and/or this.
Choose another language to work with, and re-do your code into that language; You can't run Java code without Java, the same way you can't travel by train without the train to travel with.
Upvotes: 1
Reputation: 168835
my schools computers have an older version of java and can't run it
Use the cross-compilation options of javac
when compiling it at home.
Upvotes: 5