I’m wondering how to compile/run Java programs with specific versions of the JDK/JRE on Linux. I have the J2 SE 1.3 JDK downloaded, and extracted on my desktop in Ubuntu.
I can do this on Windows with:
cd C:\Users\X\Desktop
"C:\Program Files\Java\jdk1.7.0_80\bin\javac.exe" Main.java
"C:\Program Files\Java\jdk1.7.0_80\bin\java.exe" Main
or on Mac OS with this:
cd ~/Desktop
/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac Main.java
/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java Main
I might have even done this before, but I can’t get it working now/anymore. I would appreciate it if someone could show me how to do this.
Windows uses %PATH% to hold a list of folders where it will look for executable files, macOS and Linux use $PATH. Filenames can depend on what’s handling them. Before the shell gives commandline parameters to javac, it expands * and $item aliases, and presents a space-separated list of parameters. You can put single quotes around things you don’t want the shell to touch, and double quotes around things you want the shell to expand while allowing you special characters like [space] and [plain-brackets ()].
For that library error, you may need to add other resources, especially stuff on i386 architecture, to your system to have the supporting libraries you need. More details are in my reply to your other thread.