5

I have installed Charles proxy on my Ubuntu machine.

When it starts it is stuck with the startup window (ie the one with the logo and app name). At the bottom it is saying "Loading Tools".

It is stuck on this. And does not open.

What can I do to stop it getting stuck so I can use the GUI?

radiobrain77
  • 613
  • 1
  • 6
  • 19
  • Could you please start Charles Proxy by the command line and paste here any possible error message? – Lluís Suñol Jan 18 '18 at 07:14
  • INFO [com.xk72.charles.gui.transaction.viewers.gen.ImageBodyViewer] - Error initialising WebP image reader: no webp-imageio in java.library.path WARNING [com.xk72.charles.gui.transaction.viewers.gen.ImageBodyViewer] - No WebP image reader initialised, WebP image viewing will not be available – radiobrain77 Jan 18 '18 at 12:09
  • INFO [com.xk72.charles.gui.transaction.viewers.gen.ImageBodyViewer] - Error initialising WebP image reader: Could not initialize class com.luciad.imageio.webp.WebP WARNING [com.xk72.charles.gui.transaction.viewers.gen.ImageBodyViewer] - No WebP image reader initialised, WebP image viewing will not be available – radiobrain77 Jan 18 '18 at 12:09
  • The previous two comments are the output in order. I had to break it up to get past the length restriction of comments here. – radiobrain77 Jan 18 '18 at 12:11
  • Those are normal info messages... don't worry about them. How did you installed charles? By apt-get repository or by downloading it from the web? I would suggest you to use the latest version you can download from their web. – Lluís Suñol Jan 18 '18 at 16:21
  • I had the same error message. The problem was that I did not have the Java8 runtime. I had Java 9. After installing Java9 the problem is resolved. – Brad Johnson Jan 18 '18 at 19:15
  • Looks like that is the answer. I did a full restart on my machine and the second time when I ran Charles from the command line, it started in full. And working too. On checking the Java version it was 9 and not 8. – radiobrain77 Jan 19 '18 at 00:28

1 Answers1

6

From comments: charles3 requries Java 8.

I fixed it by doing the following (Ubuntu 18, Charles installed via apt):

sudo apt update
sudo apt install openjdk-8-jre
sudo nano /usr/bin/charles3

Edit the file by adding 3 lines before # Launch Charles:

JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
JRE_HOME="$JAVA_HOME/jre"
JAVA="$JAVA_HOME/bin/java"

The file should look like this after the edit:

#!/bin/sh
######################################################################
# Charles Proxy startup script
#


# Find Charles lib directory
if [ -z "$CHARLES_LIB"]; then
    CHARLES_LIB="$(dirname "$(readlink -f "$0")")"/../lib
    if [ ! -f "$CHARLES_LIB/charles.jar" ]; then
        CHARLES_LIB="/usr/lib/charles-proxy3"
    fi
fi

if [ ! -f "$CHARLES_LIB/charles.jar" ]; then
    echo >&2 "Charles lib directory not found. Looking in $CHARLES_LIB."
    exit 1
fi

# Find Java binary
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
    hash java 2>^- || { echo >&2 "Charles couldn't start: java not found. Please install java to use Charles."; exit 1; }
    JAVA=java
elif [ ! -z "$JAVA_HOME" ]; then
    JAVA="$JAVA_HOME/bin/java"
else
    JAVA="$JRE_HOME/bin/java"
fi

# Edit: Use Java 8
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
JRE_HOME="$JAVA_HOME/jre"
JAVA="$JAVA_HOME/bin/java"

# Launch Charles
$JAVA -Xmx256M -Dcharles.config="~/.charles3.config" -jar $CHARLES_LIB/charles.jar $*
Dafang Cao
  • 897
  • 5
  • 15