mirror of
				https://gitea.com/actions/setup-java.git
				synced 2025-10-26 07:16:35 +00:00 
			
		
		
		
	Normalize extendedJavaHome environment variable
The extendedJavaHome environment variable contains `.` symbols in the version. This causes the environment variable to be ignored by the action runner. It's best to replace those and other non standard symbols with and underscore. For reference: > Environment variable names used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore) from the characters defined in Portable Character Set .
This commit is contained in:
		 Arthur Baars
					Arthur Baars
				
			
				
					committed by
					
						 Arthur Baars
						Arthur Baars
					
				
			
			
				
	
			
			
			 Arthur Baars
						Arthur Baars
					
				
			
						parent
						
							6e1616c588
						
					
				
				
					commit
					81bfa641b0
				
			
							
								
								
									
										1
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4742,6 +4742,7 @@ function getJava(version, arch, jdkFile, javaPackage) { | ||||
|             toolPath = yield tc.cacheDir(jdkDir, javaPackage, getCacheVersionString(version), arch); | ||||
|         } | ||||
|         let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch; | ||||
|         extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_'); | ||||
|         core.exportVariable('JAVA_HOME', toolPath); | ||||
|         core.exportVariable(extendedJavaHome, toolPath); | ||||
|         core.addPath(path.join(toolPath, 'bin')); | ||||
|   | ||||
| @@ -87,6 +87,7 @@ export async function getJava( | ||||
|   } | ||||
|  | ||||
|   let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch; | ||||
|   extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_'); | ||||
|   core.exportVariable('JAVA_HOME', toolPath); | ||||
|   core.exportVariable(extendedJavaHome, toolPath); | ||||
|   core.addPath(path.join(toolPath, 'bin')); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user