Comments (9)
You just set it to wherever you have java installed, using the proper directory for JAVA_HOME
https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
from trapeze.
Can you try setting JAVA_HOME
to C:\Program Files\Git\Library\Java\JavaVirtualMachines\jdk-15.0.2.jdk\Contents\Home
and see if that works?
from trapeze.
@mlynch
Ahhh that's my problem, I don't have that path on my Windows machine (I don't have the Library folder onwards).
I believe the default location for Java on Windows gets installed to a different path (I'm pretty sure I just did the default installation without changing paths) and so JAVA_HOME is:
C:\Users\hknaus>echo %JAVA_HOME%
C:\Program Files\Java\jdk-15.0.2\bin
If Trapeze is expecting the other path that you provided it would never work on Windows or I'm going to need to check the operation system that I'm building on and switch paths accordingly... or am I missing something else?
In our CI/CD scripts (which run on a Mac) we do set JAVA_HOME to /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home (in case there are multiple instances installed and the machine's default is the latest version).
from trapeze.
User error. Different environment, different JAVA_HOME paths.
from trapeze.
Glad it's working, cheers
from trapeze.
@mlynch I had two version of the JDK on my Windows machine (15.0.2, i.e. the one I need to use for this app, and 19).
javac -version
kept returning 19, regardless of me setting JAVA_HOME to 15 or not.
So I figured I would uninstall 19 altogether and that would solve the issue, but it didn't. I still have the same issue so I closed this prematurely.
This is what I'm showing:
C:\Users\hknaus>java -version
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
C:\Users\hknaus>javac -version
javac 15.0.2
C:\Users\hknaus>echo %JAVA_HOME%
C:\Program Files\Java\jdk-15.0.2\bin
C:\Users\hknaus>
The error is slightly different, looks like an additional \bin\java
is being appended to the JAVA_HOME path somewhere:
run android packageName com.Accurence.Assist
run android versionName 8.17.12
Fatal error: Error running command
Error: Unable to load or parse gradle file: Error: spawn C:\Program Files\Java\jdk-15.0.2\bin\bin\java ENOENT
at GradleFile.parse (C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\project\dist\android\gradle-file.js:228:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async GradleFile.replaceProperties (C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\project\dist\android\gradle-file.js:53:9)
at async executeOperations (C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\configure\dist\tasks\run.js:52:10)
at async runCommand (C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\configure\dist\tasks\run.js:31:9)
at async C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\configure\dist\index.js:58:13
at async Command.<anonymous> (C:\Users\hknaus\AppData\Local\npm-cache\_npx\14f6b2623fe0959a\node_modules\@trapezedev\configure\dist\util\cli.js:31:13)
from trapeze.
@mlynch It looks like \bin\Java
is being added to JAVA_HOME
on line 399
of gradle-file.js
which is line 510
in gradle-file.ts
https://github.com/ionic-team/trapeze/blob/main/packages/project/src/android/gradle-file.ts
from trapeze.
Don't add bin
to the end of JAVA_HOME
from trapeze.
I swear there was something else that required the \bin
on the path but I guess I'll find that one at a later time. ;)
@mlynch Thank you again, it's now running fine!
from trapeze.
Related Issues (20)
- Merge intent-filter HOT 2
- Unable to execute more than one `replace` or `insert` value in `variables.gradle` HOT 1
- How to pass version from package.json to versionName in yaml? HOT 1
- Bug: Incompatible with latest Capacitor V5 Android Platform HOT 6
- `@types/jest` included in dependencies HOT 1
- Bug: Incompatible with latest Capacitor V5 Android Platform HOT 12
- iOS Display name HOT 1
- XML file namespace HOT 3
- Bug: appName has no effect (android, capacitor V5) HOT 23
- Plist & Entitlements have different replace syntax in YAML file HOT 1
- Specify the Xcode signing team using `config.yaml`? HOT 1
- Error with API Usage HOT 1
- Add a file to XCode Project (e.g., GoogleService-Info.plist)?
- License? HOT 1
- Update gradle.properties HOT 5
- Documentation: Add info about the -y cmd line option HOT 3
- [project] Unused npm-watch dependency HOT 3
- Feat: hide the logs HOT 5
- Best practice for merging in root of Android manifest? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trapeze.