File tree 2 files changed +24
-4
lines changed
jdk/test/java/lang/instrument/BootClassPath
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1
1
#
2
- # Copyright (c) 2004, 2013 , Oracle and/or its affiliates. All rights reserved.
2
+ # Copyright (c) 2004, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
#
5
5
# This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,18 @@ echo "Creating manifest file..."
63
63
# java Setup <workdir> <premain-class>
64
64
# - outputs boot class path to boot.dir
65
65
66
- " $JAVA " ${TESTVMOPTS} -classpath " ${TESTCLASSES} " Setup " ${TESTCLASSES} " Agent
66
+ OS=` uname -s`
67
+ case ${OS} in
68
+ CYGWIN* )
69
+ CYGWIN=" CYGWIN"
70
+ ;;
71
+ * )
72
+ CYGWIN=" "
73
+ ;;
74
+ esac
75
+
76
+ " $JAVA " ${TESTVMOPTS} -classpath " ${TESTCLASSES} " Setup " ${TESTCLASSES} " Agent " ${CYGWIN} "
77
+
67
78
BOOTDIR=` cat ${TESTCLASSES} /boot.dir`
68
79
69
80
echo " Created ${BOOTDIR} "
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2004, 2011 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2004, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,10 @@ public static void main(String[] args) throws Exception {
45
45
}
46
46
String workDir = args [0 ];
47
47
String premainClass = args [1 ];
48
+ boolean isCygwin = false ;
49
+ if (args .length ==3 && args [2 ].equals ("CYGWIN" )) {
50
+ isCygwin = true ;
51
+ }
48
52
49
53
String manifestFile = workDir + fileSeparator + "MANIFEST.MF" ;
50
54
String bootClassPath = "boot" + suffix ();
@@ -87,7 +91,12 @@ public static void main(String[] args) throws Exception {
87
91
*/
88
92
f = new File (workDir + fileSeparator + "boot.dir" );
89
93
try (FileOutputStream out = new FileOutputStream (f )) {
90
- out .write (bootDir .getBytes (defaultEncoding ));
94
+ if (osName .startsWith ("Windows" ) && isCygwin ) {
95
+ out .write (bootDir .getBytes ("UTF-8" ));
96
+ }
97
+ else {
98
+ out .write (bootDir .getBytes (defaultEncoding ));
99
+ }
91
100
}
92
101
}
93
102
You can’t perform that action at this time.
0 commit comments