0
My company uses a maintenance-free application that I can’t change, it runs with Java 6.0.17, however in all other applications newer versions of Java are required.
As a solution I made a file .bat
to run the old version only in the application that looked like this:
"C:\Program Files (x86)\Java\jdk1.6.0_17\bin\java" -jar ChoppHouse.jar
But the CMD is open all the time and if you close it the application closes together.
I wonder if there is any command to close it without closing the application
I think only start doesn’t work, because java.exe creates a console, you may need to use javaw.exe together with start
– Leandro Godoy Rosa
I tried this setting and the problem is it gives error "Windows cannot find -jar. Make sure the name has been typed correctly"
– André Macedo
It could be, I can’t test anything right now to simulate behavior, so I check it out
– nullptr
And if you don’t use -jar it doesn’t run the application in the old version of Java
– André Macedo
Using javaw.exe thus "start javaw.exe "C: Program Files (x86) Java jdk1.6.0_17 bin java" -jar Chopphouse.jar Exit" It opens the console and closes but does not run the application
– André Macedo
I edited the answer with a test script I ran here, I was able to open Squirrel using the way it includes in the answer
– nullptr
It opens the same application and closes the CMD, however it opens the application running the latest version of java and not the selected version that in the case is the 6
– André Macedo
Using start javaw.exe looks like you will use the Java that is in your classpath, you should use javaw or java only in the initial command, as my second response. Running 'start" D: app tools jre1.8.0_151 java.exe -jar" D: app tools Squirrel-new Squirrel-sql.jar' I also managed to open Squirrel
– nullptr
Using the last form it opens but continues giving java version error, opens with the last version
– André Macedo
If possible post the error occurring in the question
– nullptr
The error it presents is specific to something that was discontinued from the new versions of JAVA, it presents the error "JDBC-ODBC/Access driver not found!"
– André Macedo